@Test void testUtfStringBuilder() { String source = "abcd012345\n\r\u0000\u00a4\u10fb\ufffdfirefly"; byte[] bytes = source.getBytes(StandardCharsets.UTF_8); Utf8StringBuilder buffer = new Utf8StringBuilder(); for (byte aByte : bytes) buffer.append(aByte); assertEquals(source, buffer.toString()); assertTrue(buffer.toString().endsWith("firefly")); }
@Override public String toString() { checkState(); return buffer.toString(); }
Utf8StringBuilder extends Utf8Appendable { @Override public String toString() { checkState(); return buffer.toString(); } }
Utf8StringBuilder extends Utf8Appendable { @Override public String toString() { checkState(); return buffer.toString(); } Utf8StringBuilder();  Utf8StringBuilder(int capacity); }
Utf8StringBuilder extends Utf8Appendable { @Override public String toString() { checkState(); return buffer.toString(); } Utf8StringBuilder();  Utf8StringBuilder(int capacity); @Override int length(); @Override void reset(); StringBuilder getStringBuilder(); @Override String toString(); }
Utf8StringBuilder extends Utf8Appendable { @Override public String toString() { checkState(); return buffer.toString(); } Utf8StringBuilder();  Utf8StringBuilder(int capacity); @Override int length(); @Override void reset(); StringBuilder getStringBuilder(); @Override String toString();  }