@Override
    public void decompress(@NotNull ByteBuffer bufferWithCompressedData,
                           byte[] bufferForDecompression) throws IOException {
      int compressedSize = bufferWithCompressedData.remaining();

      //There is a .decompress(ByteBuffer,ByteBuffer) method in LZ4Decompressor API -- allows to avoid ByteBuffer to byte[]
      // copying below -- but this method is not implemented for direct 'source' ByteBuffer in our 'fast' LZ4Decompressor
      // (see lz4.kt)

      //actual buffer returned could be > compressedSize!
      byte[] compressedBytes = threadLocalBuffer.getBuffer(compressedSize);
      bufferWithCompressedData.get(compressedBytes, 0, compressedSize);

      try {
        int bytesUsedFromCompressedData = CompressionUtil.decompressor().decompress(
          compressedBytes, 0,
          bufferForDecompression, 0, bufferForDecompression.length
        );
        if (bytesUsedFromCompressedData != compressedSize) {
          throw new IOException("Decompressed bytes[" + bytesUsedFromCompressedData + "b out of " + compressedSize + "b] " +
                                "!= compressed bytes[" + bufferForDecompression.length + "] " +
                                "=> storage is likely corrupted"
          );
        }
      }
      catch (LZ4Exception e) {
        throw new IOException("Decompressing " + compressedSize + " bytes into " + bufferForDecompression.length + " bytes failed", e);
      }
    }
@Override
    public void decompress(@NotNull ByteBuffer bufferWithCompressedData,
                           byte[] bufferForDecompression)