@Test
public void testRead() throws IOException {

  final byte[] data = new byte[] {'a', 'b', '\r', '\n', '\r', '\n', 'c', 'd'};
  @SuppressWarnings("resource")
  final SplitInputStream sin = new SplitInputStream(new ByteArrayInputStream(data), new byte[] {'\r', '\n'});
  assertEquals('a', sin.read());
  assertEquals('b', sin.read());
  assertEquals('\r', sin.read());
  assertEquals('\n', sin.read());
  assertEquals(-1, sin.read());
  assertEquals(-1, sin.read());
  final InputStream in = sin.next();
  assertEquals('\r', in.read());
  assertEquals('\n', in.read());
  assertEquals('c', in.read());
  assertEquals('d', in.read());
  assertEquals(-1, in.read());
}