@Test
public void testSimpleStreamBuffering() throws IOException {

  final byte[] array = Strings.toUtf8(TSTR);
  ByteArrayInputStream bis = new ByteArrayInputStream(array);
  MemorizingBufferedInputStream mis = new MemorizingBufferedInputStream(bis);
  int val;
  int i = 0;
  while ((val = mis.read()) > 0) {
    System.out.print((char) val);
    Assert.assertEquals(array[i], (byte) val);
    i++;
  }
  Assert.assertEquals(i, array.length);
}