/**
* Test method for {@link org.ajax4jsf.io.FastBufferOutputStream#reset()}.
*/
public void testResetTwoBuffers() throws Exception {
FastBufferOutputStream stream = new FastBufferOutputStream(256);
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());
}