@Test
public void testReadRemainder() throws Exception {

  String myMessage = "{this is my message}\n";
  byte[] bytes = myMessage.getBytes(Charsets.UTF_8);
  InputStream stream = new ByteArrayInputStream(bytes);
  DelimitedStreamReader r = new DelimitedStreamReader(stream, Charsets.UTF_8, myMessage.length() / 3);
  assertTrue(stream.read(new byte[myMessage.length()/2], 0, myMessage.length()/2) > 0);
  String remainder = r.read(myMessage.length() - myMessage.length()/2);
  assertEquals(remainder, myMessage.substring(myMessage.length()/2, myMessage.length()));
}