for (int i = 0; i < 257; i++) {
stream.write(i);
}
assertEquals(257, stream.getLength());
ByteBuffer firstBuffer = stream.getFirstBuffer();
assertNotNull(firstBuffer.getNext());
assertNull(firstBuffer.getPrevious());
stream.reset();
assertEquals(0, stream.getLength());
firstBuffer = stream.getFirstBuffer();
assertEquals(0, firstBuffer.getUsedSize());
assertNull(firstBuffer.getNext());
assertNull(firstBuffer.getPrevious());
}