}
public void testBasicOperations() throws Exception {
String text = "bla bla yada yada haha haha";
byte[] b1 = text.getBytes("US-ASCII");
BufferedLineReaderInputStream inbuffer = new BufferedLineReaderInputStream(new ByteArrayInputStream(b1), 4096);
inbuffer.fillBuffer();
assertEquals(0, inbuffer.pos());
assertEquals(27, inbuffer.limit());
assertEquals(27, inbuffer.length());
inbuffer.read();
inbuffer.read();
assertEquals(2, inbuffer.pos());
assertEquals(27, inbuffer.limit());
assertEquals(25, inbuffer.length());
byte[] tmp1 = new byte[3];
assertEquals(3, inbuffer.read(tmp1));
assertEquals(5, inbuffer.pos());
assertEquals(27, inbuffer.limit());
assertEquals(22, inbuffer.length());
byte[] tmp2 = new byte[22];
assertEquals(22, inbuffer.read(tmp2));
assertEquals(27, inbuffer.pos());
assertEquals(27, inbuffer.limit());
assertEquals(0, inbuffer.length());
assertEquals(-1, inbuffer.read(tmp1));
assertEquals(-1, inbuffer.read(tmp1));
assertEquals(-1, inbuffer.read());
assertEquals(-1, inbuffer.read());
}