@Override
    public synchronized int available() {
      return min(maxChunkSize, super.available());
    }
Implements a ByteArrayInputStream that returns only small chunks for testing.
java_src/src/main/java/com/google/crypto/tink/testing/StreamingTestUtil.java