private void zipAndWrite(ByteArraySequence bytes, int record, boolean fixedSize) throws IOException {
    BufferExposingByteArrayOutputStream s = new BufferExposingByteArrayOutputStream();
    try (DeflaterOutputStream out = new DeflaterOutputStream(s)) {
      out.write(bytes.getInternalBuffer(), bytes.getOffset(), bytes.getLength());
    }
    ByteArraySequence compressedBytes = s.toByteArraySequence();

    withWriteLock(() -> {
      super.writeBytes(record, compressedBytes, fixedSize);
      if (IndexDebugProperties.IS_UNIT_TEST_MODE) {
        recordsLogForDebug.put(record, new RecordData(compressedBytes.getLength(), compressedBytes.hashCode()));
      }
      pendingWriteRequestsSize -= bytes.getLength();
      pendingWriteRequests.remove(record);
    });
  }
private void zipAndWrite(ByteArraySequence bytes, int record, boolean fixedSize)