private void put(byte[] b, int offset, int length) throws IOException {
    if (isClosed) {
      throw new EOFException();
    }
    while (length > 0) {
      int bytesToWrite = Math.min(BLOCK_SIZE - blockOutputStream.size(), length);
      blockOutputStream.write(b, offset, bytesToWrite);
      if (blockOutputStream.size() >= BLOCK_SIZE) {
        save();
      }
      offset += bytesToWrite;
      length -= bytesToWrite;
    }
  }
private void put(byte[] b, int offset, int length)