@Test
public void testReadFullyRemainder() throws Exception {

  String myMessage = "{this is my message}";
  byte[] bytes = myMessage.getBytes(Charsets.UTF_8);
  InputStream stream = new ByteArrayInputStream(bytes);
  Reader reader = new InputStreamReader(stream);
  char[] buffer = new char[myMessage.length()];
  IOUtils.readFully(reader, buffer, myMessage.length()/2);
  for (int i = 0; i < myMessage.length(); i++) {
    if (i < myMessage.length()/2) {
      assertEquals(buffer[i], 0);
    } else {
      assertEquals(buffer[i], myMessage.charAt(i - myMessage.length()/2));
    }
  }
}