public void testExceptionHandling() throws Exception {
// Create an input stream than has 2 records in the first 9 bytes and exception while the 3rd
// record is read
byte[] content = new byte[] {1, 2, 3, 4, 0, 6, 7, 8, 0, 10, 11, 12};
try (CountingInputStream countingInputStream =
new CountingInputStream(new ExceptionThrowingInputStream(
new BufferedInputStream(new NonResetableByteArrayInputStream(content)), 11))) {
LineInputStream iterator =
new TestLineInputReader(countingInputStream, content.length, false, (byte) 0);
byte[] next = iterator.next();
assertNotNull(next);