Convert a Node into a simple String representation
and append to StringBuffer
@param buf
@param nodeDetail
19618
public static void appendNodeDetail(StringBuffer buf, NodeDetail nodeDetail) {
        appendNodeDetail(buf, nodeDetail.getNode(), true);
        buf.append(" at ").append(nodeDetail.getXpathLocation());
    }
1237395
private final void appendContents(StringBuffer buf,
                                      CharacterIterator iterator) {
        int index = iterator.getBeginIndex();
        int end = iterator.getEndIndex();

        while (index < end) {
            iterator.setIndex(index++);
            buf.append(iterator.current());
        }
    }
1015981
public static void append(StringBuilder buf, byte b, int base) {
        int bi = 0xff & b;
        int c = '0' + (bi / base) % base;
        if (c > '9')
            c = 'a' + (c - '0' - 10);
        buf.append((char) c);
        c = '0' + bi % base;
        if (c > '9')
            c = 'a' + (c - '0' - 10);
        buf.append((char) c);
    }
1273383
public void flattenToBuffer(ByteBuffer buf) {
        ByteBuffer dup = m_buffer.duplicate();
        buf.putInt(dup.limit());
        dup.position(0);
        buf.put(dup);
    }
869553
public static void quote(StringBuilder buf, String str) {
        buf.append('"');
        escape(buf, str);
        buf.append('"');
    }
805839
public void serialize(final ByteBuffer buf) {

		checkInvariants();

		if (!sizeIsSticky)
			trimToSize();

		buf.putInt(wordsInUse);
		for (int i = 0; i < wordsInUse; i++) {
			buf.putLong(words[i]);
		}
	}
400666
private void appendDetailedString(int level, StringBuilder stringBuilder) {
    String pad = Strings.repeat("--", level);
    stringBuilder.append(pad).append(this).append(SystemUtils.LINE_SEPARATOR);
    for (ProductPartitionNode childNode : getChildren()) {
      childNode.appendDetailedString(level + 1, stringBuilder);
    }
  }
20780
public static void appendElapsed(StringBuilder buf, long elapsedNanos) {
        if (elapsedNanos >= 100000000000L) { // >= 100 s
            buf.append(elapsedNanos / 1000000000L).append("s(").append(elapsedNanos).append("ns)");
        } else if (elapsedNanos >= 100000000L) { // >= 100 ms
            buf.append(elapsedNanos / 1000000L).append("ms(").append(elapsedNanos).append("ns)");
        } else if (elapsedNanos >= 100000L) { // >= 100 us
            buf.append(elapsedNanos / 1000L).append("\u00B5s(").append(elapsedNanos).append("ns)"); // microsecs
        } else {
            buf.append(elapsedNanos).append("ns");
        }
    }
1076669
private static <T> StringBuilder appendAllTo(final StringBuilder buf, final String sep, final T... types) {
        Assert.requireNonNullEntries(types, "types");
        Assert.requireNotEmpty(types, "types");
        if (types.length > 0) {
            buf.append(toString(types[0]));
            for (int i = 1; i < types.length; i++) {
                buf.append(sep).append(toString(types[i]));
            }
        }
        return buf;
    }
300580
private void printInfoContexts(StringBuilder buf, String uri, boolean reduceDisplay, boolean allowCmd, long host, Node.VHostMapping vhost, Node node) {
        if (!reduceDisplay)
            buf.append("<h3>Contexts:</h3>");
        buf.append("<pre>");
        for (Context context : node.getContexts()) {
            if (context.getVhost() == vhost) {
                String status = "REMOVED";
                switch (context.getStatus()) {
                    case ENABLED:
                        status = "ENABLED";
                        break;
                    case DISABLED:
                        status = "DISABLED";
                        break;
                    case STOPPED:
                        status = "STOPPED";
                        break;
                }
                buf.append(context.getPath() + " , Status: " + status + " Request: " + context.getActiveRequests() + " ");
                if (allowCmd) {
                    contextCommandString(buf, uri, context.getStatus(), context.getPath(), vhost.getAliases(), node.getJvmRoute());
                }
                buf.append("\n");
            }
        }
        buf.append("</pre>");
    }
1311993
public static void writeString(String value, ByteBuffer buf) {
        if (value == null) {
            buf.putInt(VoltType.NULL_STRING_LENGTH);
            return;
        }

        byte[] strbytes = value.getBytes(Constants.UTF8ENCODING);
        int len = strbytes.length;

        buf.putInt(len);
        buf.put(strbytes);
    }
49898
public static void appendPrettyHexDump(StringBuilder dump, ByteBuf buf, int offset, int length) {
        HexUtil.appendPrettyHexDump(dump, buf, offset, length);
    }
722939
public void write(io.netty.buffer.ByteBuf buf) throws IOException {
    write(buf, 0, buf.readableBytes());
  }
16430
private void appendLine(final String timeStampStr, final int indentLevel, final String line,
            final StringBuilder buf) {
        buf.append(timeStampStr);
        buf.append('\t');
        buf.append(ClassGraph.class.getSimpleName());
        buf.append('\t');
        final int numDashes = 2 * (indentLevel - 1);
        for (int i = 0; i < numDashes; i++) {
            buf.append('-');
        }
        if (numDashes > 0) {
            buf.append(' ');
        }
        buf.append(line);
        buf.append('\n');
    }
666042
public static String toDetailString(ByteBuffer buffer) {
        if (buffer == null)
            return "null";

        StringBuilder buf = new StringBuilder();
        idString(buffer, buf);
        buf.append("[p=");
        buf.append(buffer.position());
        buf.append(",l=");
        buf.append(buffer.limit());
        buf.append(",c=");
        buf.append(buffer.capacity());
        buf.append(",r=");
        buf.append(buffer.remaining());
        buf.append("]={");

        appendDebugString(buf, buffer);

        buf.append("}");

        return buf.toString();
    }
183494
private void setRDFAsDatastream(StringBuffer buf) {

        DatastreamXMLMetadata ds = new DatastreamXMLMetadata();
        // set the attrs common to all datastream versions
        ds.DatastreamID = "RELS-INT";
        ds.DSVersionable = false;
        ds.DSFormatURI = m_dsFormatURI;
        ds.DatastreamAltIDs = m_dsAltIDs;
        ds.DSVersionID = "RELS-INT.0";
        ds.DSLabel =
                "DO NOT EDIT: System-generated datastream to preserve METS DMDID/ADMID relationships.";
        ds.DSCreateDT = new Date();
        ds.DSMIME = "application/rdf+xml";
        // set the attrs specific to datastream version
        ds.DSControlGrp = "X";
        ds.DSState = "A";
        ds.DSLocation =
                m_obj.getPid() + "+" + ds.DatastreamID + "+" + ds.DSVersionID;
        ds.DSLocationType = Datastream.DS_LOCATION_TYPE_INTERNAL;
        ds.DSInfoType = "DATA";
        ds.DSMDClass = DatastreamXMLMetadata.TECHNICAL;

        // now set the xml content stream itself...
        try {
            ds.xmlContent = buf.toString().getBytes(m_characterEncoding);
            ds.DSSize = ds.xmlContent.length;
        } catch (UnsupportedEncodingException uee) {
            logger.error("Encoding error when creating RELS-INT datastream", uee);
        }
        // FINALLY! add the RDF and an inline xml datastream in the digital object
        m_obj.addDatastreamVersion(ds, true);
    }
637740
function infoBuffer(buf, cb) {
  try {
    buf = bufferUtils.toBuffer(buf);
    info(buf, cb);
  } catch(err) {
    cb(err);
  }
}