public void setLength(int newLength) { if (newLength > length) { // grow reserve(newLength - length, true); } length = newLength; }
public ByteStringBuilder append(byte[] bytes) { int length = this.length; int bl = bytes.length; reserve(bl, false); System.arraycopy(bytes, 0, content, length, bl); this.length = length + bl; return this; }
public ByteStringBuilder append(byte[] bytes, int offs, int len) { reserve(len, false); int length = this.length; System.arraycopy(bytes, offs, content, length, len); this.length = length + len; return this; }
public ByteStringBuilder appendLatin1(CharSequence s, int offs, int len) { reserve(len, false); char c; for (int i = 0; i < len; i ++) { c = s.charAt(i + offs); if (c > 255) throw new IllegalArgumentException(); doAppendNoCheck((byte) c); } return this; }
public ByteStringBuilder appendDigestResult(final MessageDigest messageDigest) throws DigestException { reserve(messageDigest.getDigestLength(), false); final int length = this.length; final byte[] content = this.content; this.length = length + messageDigest.digest(content, length, content.length - length); return this; }
public ByteStringBuilder appendLatin1(String s) { int len = s.length(); reserve(len, false); char c; for (int i = 0; i < len; i ++) { c = s.charAt(i); if (c > 255) throw new IllegalArgumentException(); doAppendNoCheck((byte) c); } return this; }
public ByteStringBuilder appendLatin1(String s, int offs, int len) { reserve(len, false); char c; for (int i = 0; i < len; i ++) { c = s.charAt(i + offs); if (c > 255) throw new IllegalArgumentException(); doAppendNoCheck((byte) c); } return this; }
public ByteStringBuilder appendLatin1(CharSequence s) { int len = s.length(); reserve(len, false); char c; for (int i = 0; i < len; i ++) { c = s.charAt(i); if (c > 255) throw new IllegalArgumentException(); doAppendNoCheck((byte) c); } return this; }
public void setLength(int newLength) { if (newLength > length) { // grow reserve(newLength - length, true); } length = newLength; }
public ByteStringBuilder append(byte[] bytes) { int length = this.length; int bl = bytes.length; reserve(bl, false); System.arraycopy(bytes, 0, content, length, bl); this.length = length + bl; return this; }
public ByteStringBuilder append(byte[] bytes, int offs, int len) { reserve(len, false); int length = this.length; System.arraycopy(bytes, offs, content, length, len); this.length = length + len; return this; }
public ByteStringBuilder append(byte[] bytes) { int length = this.length; int bl = bytes.length; reserve(bl, false); System.arraycopy(bytes, 0, content, length, bl); this.length = length + bl; return this; }
public ByteStringBuilder appendDigestResult(final MessageDigest messageDigest) throws DigestException { reserve(messageDigest.getDigestLength(), false); final int length = this.length; final byte[] content = this.content; this.length = length + messageDigest.digest(content, length, content.length - length); return this; }
public ByteStringBuilder appendLatin1(CharSequence s) { int len = s.length(); reserve(len, false); char c; for (int i = 0; i < len; i ++) { c = s.charAt(i); if (c > 255) throw new IllegalArgumentException(); doAppendNoCheck((byte) c); } return this; }
public ByteStringBuilder appendLatin1(CharSequence s, int offs, int len) { reserve(len, false); char c; for (int i = 0; i < len; i ++) { c = s.charAt(i + offs); if (c > 255) throw new IllegalArgumentException(); doAppendNoCheck((byte) c); } return this; }
public ByteStringBuilder appendDigestResult(final MessageDigest messageDigest) throws DigestException { reserve(messageDigest.getDigestLength(), false); final int length = this.length; final byte[] content = this.content; this.length = length + messageDigest.digest(content, length, content.length - length); return this; }
public ByteStringBuilder appendLatin1(String s) { int len = s.length(); reserve(len, false); char c; for (int i = 0; i < len; i ++) { c = s.charAt(i); if (c > 255) throw new IllegalArgumentException(); doAppendNoCheck((byte) c); } return this; }
public ByteStringBuilder appendLatin1(String s, int offs, int len) { reserve(len, false); char c; for (int i = 0; i < len; i ++) { c = s.charAt(i + offs); if (c > 255) throw new IllegalArgumentException(); doAppendNoCheck((byte) c); } return this; }
public ByteStringBuilder appendLatin1(String s) { int len = s.length(); reserve(len, false); char c; for (int i = 0; i < len; i ++) { c = s.charAt(i); if (c > 255) throw new IllegalArgumentException(); doAppendNoCheck((byte) c); } return this; }
public ByteStringBuilder appendLatin1(String s, int offs, int len) { reserve(len, false); char c; for (int i = 0; i < len; i ++) { c = s.charAt(i + offs); if (c > 255) throw new IllegalArgumentException(); doAppendNoCheck((byte) c); } return this; }