private BufferExposingByteArrayOutputStream internalReadStream(int record) throws IOException {
    waitForPendingWriteForRecord(record);
    byte[] result = withReadLock(() -> super.readBytes(record));

    if (IndexDebugProperties.IS_UNIT_TEST_MODE) {
      doRecordSanityCheck(record, result);
    }

    try (InflaterInputStream in = new CustomInflaterInputStream(result)) {
      final BufferExposingByteArrayOutputStream outputStream = new BufferExposingByteArrayOutputStream();
      StreamUtil.copy(in, outputStream);
      return outputStream;
    }
  }
private BufferExposingByteArrayOutputStream internalReadStream(int record)