* Tests that reading multiple bytes at once
* updates the line number appropriately.
*/
public void testReadManyBytes() throws IOException {
String s = "Yada\r\nyada\r\nyada\r\n";
RootInputStream is =
new RootInputStream(new ByteArrayInputStream(s.getBytes()));
byte[] buf = new byte[4];
assertEquals(1, is.getLineNumber());
is.read(buf);
assertEquals(1, is.getLineNumber());
is.read(buf);
assertEquals(2, is.getLineNumber());
is.read(buf);
assertEquals(3, is.getLineNumber());
is.read(buf);
assertEquals(3, is.getLineNumber());
is.read(buf);
assertEquals(4, is.getLineNumber());
assertEquals(-1, is.read());
}