public static int writeCompressed(@NotNull DataOutput out, byte @NotNull [] bytes, int start, int length) throws IOException {
    if (length > COMPRESSION_THRESHOLD) {
      LZ4Compressor compressor = compressor();

      byte[] compressedOutputBuffer = spareBufferLocal.getBuffer(compressor.maxCompressedLength(length));
      int compressedSize = compressor.compress(bytes, start, length, compressedOutputBuffer, 0);
      if (compressedSize < length) {
        int val = -compressedSize;
        DataInputOutputUtilRt.writeINT(out, val);
        DataInputOutputUtilRt.writeINT(out, length - compressedSize);
        out.write(compressedOutputBuffer, 0, compressedSize);
        return compressedSize;
      }
    }
    DataInputOutputUtilRt.writeINT(out, length);
    out.write(bytes, start, length);
    return length;
  }
public static int writeCompressed(@NotNull DataOutput out, byte @NotNull [] bytes, int start, int length)