@Test
public void testStreamBuffering() throws IOException {

  test(TSTR, 8, true);
  for (int i = 0; i < 100; i++) {
    ThreadLocalRandom rnd = ThreadLocalRandom.current();
    int nrChars = rnd.nextInt(0, 100000);
    int bufferSize = rnd.nextInt(2, 100000);
    StringBuilder sb = generateTestStr(nrChars);
    test(sb.toString(), bufferSize, true);
    testBuff(sb, 8192);
    testBuff(sb, 32);
  }
}