@Test
public void testReadlineMultipleHugeBuffer() throws Exception {

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