@Override
    public int read(byte[] b, int off, int len) throws IOException {
      int result = super.read(b, off, len);
      if (result != -1) {
        makeRoom(result);
        System.arraycopy(b, off, readBytes, idx, result);
        idx += result;
      }
      return result;
    }
Writes all the bytes, read or skipped, since the last reset to the specified output stream.
Does a mark and reset after the write.
geode-core/src/main/java/org/apache/geode/internal/statistics/ArchiveSplitter.java