public ByteStringBuilder appendTo(final ByteStringBuilder builder) { builder.append(bytes, offs + idx, len - idx); idx = len; return builder; } };
public ByteStringBuilder appendObject(Object o) { appendLatin1(String.valueOf(o)); return this; }
public ByteStringBuilder append(char c) { return appendUtf8Raw((int) c); }
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 void setLength(int newLength) { if (newLength > length) { // grow reserve(newLength - length, true); } length = newLength; }
public boolean contentEquals(final byte[] other) { return contentEquals(other, 0, other.length); }
ByteStringBuilder pemCertificate = new ByteStringBuilder(); Pem.generatePemX509Certificate(pemCertificate, certificate); fos.write(pemCertificate.toArray()); } else { fos.write(certificate.getEncoded());
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 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 boolean contentEquals(final byte[] other) { return contentEquals(other, 0, other.length); }
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 append(ByteStringBuilder other) { append(other.content, 0, other.length); 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(CharSequence s, int offs, int len) { int c; int i = 0; while (i < len) { c = s.charAt(offs + i++); if (Character.isHighSurrogate((char) c)) { if (i < len) { char t = s.charAt(offs + i ++); if (! Character.isLowSurrogate(t)) { throw new IllegalArgumentException(); } c = Character.toCodePoint((char) c, t); } else { throw new IllegalArgumentException(); } } appendUtf8Raw(c); } return this; }
public ByteStringBuilder append(boolean b) { appendLatin1(Boolean.toString(b)); return this; }