Append to a string buffer.

@param buf Buffer
@param meta Relation metadata (for labels)
@return String buffer for chaining.
10517
public StringBuilder appendTo(StringBuilder buf, VectorFieldTypeInformation<BitVector> meta) {
    this.antecedent.appendTo(buf, meta);
    buf.append(" --> ");
    this.consequent.appendItemsTo(buf, meta);
    buf.append(": ");
    buf.append(union.getSupport());
    buf.append(" : ");
    buf.append(this.measure);
    return buf;
  }
1318574
public static String toPGString(byte[] buf) {
    if (buf == null) {
      return null;
    }
    StringBuilder stringBuilder = new StringBuilder(2 * buf.length);
    for (byte element : buf) {
      int elementAsInt = (int) element;
      if (elementAsInt < 0) {
        elementAsInt = 256 + elementAsInt;
      }
      // we escape the same non-printable characters as the backend
      // we must escape all 8bit characters otherwise when convering
      // from java unicode to the db character set we may end up with
      // question marks if the character set is SQL_ASCII
      if (elementAsInt < 040 || elementAsInt > 0176) {
        // escape charcter with the form \000, but need two \\ because of
        // the Java parser
        stringBuilder.append("\\");
        stringBuilder.append((char) (((elementAsInt >> 6) & 0x3) + 48));
        stringBuilder.append((char) (((elementAsInt >> 3) & 0x7) + 48));
        stringBuilder.append((char) ((elementAsInt & 0x07) + 48));
      } else if (element == (byte) '\\') {
        // escape the backslash character as \\, but need four \\\\ because
        // of the Java parser
        stringBuilder.append("\\\\");
      } else {
        // other characters are left alone
        stringBuilder.append((char) element);
      }
    }
    return stringBuilder.toString();
  }
125649
protected StringBuffer translatedReplacements (String key, StringBuffer buf)
    {
        MessageBundle bundle = _ctx.getMessageManager().getBundle(_bundle);
        if (!bundle.exists(key)) {
            return buf;
        }
        StringTokenizer st = new StringTokenizer(bundle.get(key), "#");
        // apply the replacements to each mogrification that matches
        while (st.hasMoreTokens()) {
            String pattern = st.nextToken();
            String replace = st.nextToken();
            Matcher m = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE).matcher(buf);
            if (m.find()) {
                buf = new StringBuffer();
                m.appendReplacement(buf, replace);
                // they may match more than once
                while (m.find()) {
                    m.appendReplacement(buf, replace);
                }
                m.appendTail(buf);
            }
        }
        return buf;
    }
37244
public void addUsageTo(final StringBuilder buf) {
    final ArrayList<String> names = new ArrayList<String>(options.keySet());
    Collections.sort(names);
    int max_length = 0;
    for (final String name : names) {
      final String[] opt = options.get(name);
      final int length = name.length()
        + (opt[0] == null ? 0 : opt[0].length() + 1);
      if (length > max_length) {
        max_length = length;
      }
    }
    for (final String name : names) {
      final String[] opt = options.get(name);
      int length = name.length();
      buf.append("  ").append(name);
      if (opt[0] != null) {
        length += opt[0].length() + 1;
        buf.append('=').append(opt[0]);
      }
      for (int i = length; i <= max_length; i++) {
        buf.append(' ');
      }
      buf.append(opt[1]).append('\n');
    }
  }
670460
public byte[] toBinary(Object value, Object meta, boolean insertMeta) {
		return serialize(value, meta, insertMeta);
	}
1041725
public static void appendEpochMicros(StringBuilder buf, long timeMicros) {
        buf.append(dateTimeFormatter.format(Instant.ofEpochMilli(TimeUnit.MICROSECONDS.toMillis(timeMicros))))
           .append('(').append(timeMicros).append(')');
    }
1308749
public void meta(MetaMessage meta) {
		//System.out.println("Meta Message detected : " + meta.getType());
		if (meta.getType()==MidiMessageType.TEMPO_CHANGE ||
				// Work around part with generic meta message work around
				(meta.getType()==MidiMessageType.MARKER && MetaMessageWA.isTempoMessage(meta))
				) {
			int expectdNotesNbPerMn = TempoMessage.getTempo(meta.getData()).getNotesNumberPerMinute();
			//System.out.println("detected tempo change : " + expectdNotesNbPerMn +
			//		" current seq tempo : " + seq.getTempoInBPM());
			// Work around for JDK 1.5 (seems to work in JDK 1.4....)
			if ((int)seq.getTempoInBPM()!=expectdNotesNbPerMn)
				seq.setTempoInBPM(expectdNotesNbPerMn);
			notifyForTempoChange((int)seq.getTempoInBPM());
		}
		else
			if (meta.getType()==MidiMessageType.NOTE_INDEX_MARKER) {
				//FIXME notifyNotePlayedChange, use MusicReference? what is NoteIndexMessage.getIndex
				//notifyNotePlayedChanged((NoteAbstract)m_tune.getMusic().elementAt(NoteIndexMessage.getIndex(meta.getData())));
			}
			else
				if (MetaMessageWA.isNotationMarker(meta)) {
					//System.out.println("NOTATION MARKER");
					int begin = NotationMarkerMessage.getBeginOffset(meta.getData());
					int end = NotationMarkerMessage.getEndOffset(meta.getData());
					notifyForPartPlayedChanged (begin, end);
				}
				else
					if (meta.getType()==MidiMessageType.END_OF_TRACK) {
						notifyForPlayEnd();
					}
  }
1258358
public byte[] toBinary(Object value, Object meta, boolean insertMeta) {
		return toBinary(value, meta, insertMeta, (input) -> {
			return mapper.writeValueAsBytes(input);
		}
231511
public static void appendString(final StringBuffer buf, final String s) {
        buf.append('\"');
        for (int i = 0; i < s.length(); ++i) {
            char c = s.charAt(i);
            if (c == '\n') {
                buf.append("\\n");
            } else if (c == '\r') {
                buf.append("\\r");
            } else if (c == '\\') {
                buf.append("\\\\");
            } else if (c == '"') {
                buf.append("\\\"");
            } else if (c < 0x20 || c > 0x7f) {
                buf.append("\\u");
                if (c < 0x10) {
                    buf.append("000");
                } else if (c < 0x100) {
                    buf.append("00");
                } else if (c < 0x1000) {
                    buf.append('0');
                }
                buf.append(Integer.toString(c, 16));
            } else {
                buf.append(c);
            }
        }
        buf.append('\"');
    }
11450
public static void appendPrettyHexDump(StringBuilder dump, ByteBuf buf) {
        appendPrettyHexDump(dump, buf, buf.readerIndex(), buf.readableBytes());
    }
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;
    }
893697
function bufferToString (buf) {
  const a = bufferToTuples(buf)
  const b = tuplesToStringTuples(a)
  return stringTuplesToString(b)
}
525662
void toStringParamValueOnly(final StringBuilder buf) {
        if (value == null) {
            buf.append("null");
        } else {
            final Object paramVal = value.get();
            final Class<?> valClass = paramVal.getClass();
            if (valClass.isArray()) {
                buf.append('[');
                for (int j = 0, n = Array.getLength(paramVal); j < n; j++) {
                    if (j > 0) {
                        buf.append(", ");
                    }
                    final Object elt = Array.get(paramVal, j);
                    buf.append(elt == null ? "null" : elt.toString());
                }
                buf.append(']');
            } else if (paramVal instanceof String) {
                buf.append('"');
                buf.append(paramVal.toString().replace("\"", "\\\"").replace("\n", "\\n").replace("\r", "\\r"));
                buf.append('"');
            } else if (paramVal instanceof Character) {
                buf.append('\'');
                buf.append(paramVal.toString().replace("'", "\\'").replace("\n", "\\n").replace("\r", "\\r"));
                buf.append('\'');
            } else {
                buf.append(paramVal.toString());
            }
        }
    }
90143
protected void addWhoData (StringBuilder buf)
    {
        buf.append(getOid());
        if (status != OccupantInfo.ACTIVE) {
            buf.append(" ").append(getStatusTranslation());
        }
    }
503728
public void add(final byte[] buf, final int offset, final int len) {
    segments.add(new BufferSegment(buf, offset, len));
    total_length += len;
  }
162594
private static StringBuffer generateBody(MetaEntity entity, Context context) {
		StringWriter sw = new StringWriter();
		PrintWriter pw = null;
		try {
			pw = new PrintWriter( sw );

			if ( context.addGeneratedAnnotation() ) {
				pw.println( writeGeneratedAnnotation( entity, context ) );
			}
			if ( context.isAddSuppressWarningsAnnotation() ) {
				pw.println( writeSuppressWarnings() );
			}

			pw.println( writeStaticMetaModelAnnotation( entity ) );

			printClassDeclaration( entity, pw, context );

			pw.println();

			List<MetaAttribute> members = entity.getMembers();
			for ( MetaAttribute metaMember : members ) {
				pw.println( "	" + metaMember.getDeclarationString() );
			}

			pw.println();
			pw.println( "}" );
			return sw.getBuffer();
		}
		finally {
			if ( pw != null ) {
				pw.close();
			}
		}
	}
38499
private static <T> StringBuilder appendAllTo(final StringBuilder buf, final String sep, final T... types) {
        Validate.notEmpty(Validate.noNullElements(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;
    }