@Test
public void testSlice() {

    byteArray = ByteArray.valueOf("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
    ByteArray ba = byteArray.slice(10, 10);
    String s = ba.readAsString();
    assertTrue("KLMNOPQRST".equals(s));
    dumpBuffer("sliceBefore", byteArray.getBuffer());
    dumpBuffer("sliceAfter ", ba.getBuffer());
    ByteArrayDumpFormatter.dumpByteArray("sliceBefore", byteArray);
    ByteArrayDumpFormatter.dumpByteArray("sliceAfter", ba);
    byte[] bs = ba.read(0, ba.getLength());
    ByteArrayDumpFormatter.dumpByteArray("sliceBS", bs);
    dumpBuffer("sliceBS    ", ba.getBuffer());
}