@Test
public void testMultibyteCharacters() throws Exception {

  String myMessage = "{this is my message: héÿ}\n";
  byte[] bytes = myMessage.getBytes(Charsets.UTF_8);

  InputStream stream = new ByteArrayInputStream(bytes);
  DelimitedStreamReader r = new DelimitedStreamReader(stream, Charsets.UTF_8, myMessage.length() / 3);

  // read less bytes than the actual message, but we're lenient so we'll read up to the newline
  String msg = r.read(myMessage.length());
  assertEquals(msg, myMessage);
}