ArrayByteSequence implements Serializable, Comparable<ArrayByteSequence> { public String toString() { return new String(this.data, this.offset, this.length, StandardCharsets.UTF_8); } ArrayByteSequence(final byte[] data);  ArrayByteSequence(final byte[] data, final int offset, final int length);  ArrayByteSequence(final String s);  ArrayByteSequence(final ByteBuffer buffer); byte byteAt(final int i); byte[] getBackingArray(); boolean isBackedByArray(); int length(); int offset(); byte[] toArray(); String toString(); ArrayByteSequence subSequence(final int start, final int end); static int compareBytes(final ArrayByteSequence bs1, final ArrayByteSequence bs2); int compareTo(final ArrayByteSequence obs); boolean equals(final Object o); int hashCode();  }
@Test public void testFromByteBuffer() { final ByteBuffer bb = ByteBuffer.wrap(data, 1, 4); abs = new ArrayByteSequence(bb); assertEquals("mile", abs.toString()); }
@Test public void testFromReadOnlyByteBuffer() { final ByteBuffer bb = ByteBuffer.wrap(data, 1, 4).asReadOnlyBuffer(); abs = new ArrayByteSequence(bb); assertEquals("mile", abs.toString()); }
@Test public void testToString() { assertEquals("", new ArrayByteSequence("").toString(), "String conversion should round trip correctly"); }