public Buffer prepend(Buffer asb) { if (asb == null) return prependNull(); int len = asb.length(); ensureCapacityInternal(count + len); System.arraycopy(value, 0, value, len, count); asb.getChars(0, len, value, 0); count += len; return this; }
public Buffer prepend(Buffer asb) { if (asb == null) return prependNull(); int len = asb.length(); ensureCapacityInternal(count + len); System.arraycopy(value, 0, value, len, count); asb.getChars(0, len, value, 0); count += len; return this; }
public Buffer prepend(long l) { if (l == Long.MIN_VALUE) { append("-9223372036854775808"); return this; } int appendedLength = (l < 0) ? stringSize(-l) + 1 : stringSize(l); int spaceNeeded = count + appendedLength; ensureCapacityInternal(spaceNeeded); System.arraycopy(value, 0, value, appendedLength, count); getChars(l, appendedLength, value); count = spaceNeeded; return this; }
buf.getChars(0, len, result, 0); return result;
buf.getChars(0, len, result, 0); return result;
/** * Appends the string representation of the {@code long} * argument to this sequence. * <p> * The overall effect is exactly as if the argument were converted * to a string by the method {@link String#valueOf(long)}, * and the characters of that string were then * {@link #append(String) appended} to this character sequence. * * @param l a {@code long}. * @return a reference to this object. */ public Buffer append(long l) { if (l == Long.MIN_VALUE) { append("-9223372036854775808"); return this; } int appendedLength = (l < 0) ? stringSize(-l) + 1 : stringSize(l); int spaceNeeded = count + appendedLength; ensureCapacityInternal(spaceNeeded); getChars(l, spaceNeeded, value); count = spaceNeeded; return this; }
/** * Appends the string representation of the {@code int} * argument to this sequence. * <p> * The overall effect is exactly as if the argument were converted * to a string by the method {@link String#valueOf(int)}, * and the characters of that string were then * {@link #append(String) appended} to this character sequence. * * @param i an {@code int}. * @return a reference to this object. */ public Buffer append(int i) { if (i == Integer.MIN_VALUE) { append("-2147483648"); return this; } int appendedLength = (i < 0) ? stringSize(-i) + 1 : stringSize(i); int spaceNeeded = count + appendedLength; ensureCapacityInternal(spaceNeeded); getChars(i, spaceNeeded, value); count = spaceNeeded; return this; }
/** * Appends the string representation of the {@code long} * argument to this sequence. * <p> * The overall effect is exactly as if the argument were converted * to a string by the method {@link String#valueOf(long)}, * and the characters of that string were then * {@link #append(String) appended} to this character sequence. * * @param l a {@code long}. * @return a reference to this object. */ public Buffer append(long l) { if (l == Long.MIN_VALUE) { append("-9223372036854775808"); return this; } int appendedLength = (l < 0) ? stringSize(-l) + 1 : stringSize(l); int spaceNeeded = count + appendedLength; ensureCapacityInternal(spaceNeeded); getChars(l, spaceNeeded, value); count = spaceNeeded; return this; }
/** * Appends the string representation of the {@code int} * argument to this sequence. * <p> * The overall effect is exactly as if the argument were converted * to a string by the method {@link String#valueOf(int)}, * and the characters of that string were then * {@link #append(String) appended} to this character sequence. * * @param i an {@code int}. * @return a reference to this object. */ public Buffer append(int i) { if (i == Integer.MIN_VALUE) { append("-2147483648"); return this; } int appendedLength = (i < 0) ? stringSize(-i) + 1 : stringSize(i); int spaceNeeded = count + appendedLength; ensureCapacityInternal(spaceNeeded); getChars(i, spaceNeeded, value); count = spaceNeeded; return this; }
public Buffer prepend(int i) { if (i == Integer.MIN_VALUE) { prepend("-2147483648"); return this; } int appendedLength = (i < 0) ? stringSize(-i) + 1 : stringSize(i); int spaceNeeded = count + appendedLength; ensureCapacityInternal(spaceNeeded); System.arraycopy(value, 0, value, appendedLength, count); getChars(i, appendedLength, value); count = spaceNeeded; return this; }
public Buffer prepend(int i) { if (i == Integer.MIN_VALUE) { prepend("-2147483648"); return this; } int appendedLength = (i < 0) ? stringSize(-i) + 1 : stringSize(i); int spaceNeeded = count + appendedLength; ensureCapacityInternal(spaceNeeded); System.arraycopy(value, 0, value, appendedLength, count); getChars(i, appendedLength, value); count = spaceNeeded; return this; }
public Buffer append(Buffer asb) { if (asb == null) return appendNull(); int len = asb.length(); ensureCapacityInternal(count + len); asb.getChars(0, len, value, count); count += len; return this; }
public Buffer prepend(long l) { if (l == Long.MIN_VALUE) { append("-9223372036854775808"); return this; } int appendedLength = (l < 0) ? stringSize(-l) + 1 : stringSize(l); int spaceNeeded = count + appendedLength; ensureCapacityInternal(spaceNeeded); System.arraycopy(value, 0, value, appendedLength, count); getChars(l, appendedLength, value); count = spaceNeeded; return this; }
public Buffer append(Buffer asb) { if (asb == null) return appendNull(); int len = asb.length(); ensureCapacityInternal(count + len); asb.getChars(0, len, value, count); count += len; return this; }