@Override
    public int read() throws IOException {
      int result = super.read();
      if (result != -1) {
        makeRoom(1);
        readBytes[idx] = (byte) result;
        idx += 1;
      }
      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