@Test
public void testReadlineMultipleSmallBuffer() throws Exception {

  String myMessage = "{msg1}\r\n";
  String myMessage2 = "{this is my message}\n";
  String myMessage3 = "{this is my message2}\r\n";
  byte[] bytes = (myMessage + myMessage2 + myMessage3).getBytes(Charsets.UTF_8);
  InputStream stream = new ByteArrayInputStream(bytes);
  DelimitedStreamReader r = new DelimitedStreamReader(stream, Charsets.UTF_8, myMessage.length());
  String msg1 = r.readLine();
  String msg2 = r.readLine();
  String msg3 = r.readLine();
  assertEquals(msg1, myMessage.trim());
  assertEquals(msg2, myMessage2.trim());
  assertEquals(msg3, myMessage3.trim());
}