@Override
    public ByteArraySequence compress(@NotNull ByteArraySequence input, boolean mayReturnReusableBufferHint) throws IOException {
      Deflater deflater = new Deflater();
      try {
        deflater.setInput(input.getInternalBuffer(), input.getOffset(), input.length());
        deflater.finish();
        UnsyncByteArrayOutputStream compressedBytesStream = new UnsyncByteArrayOutputStream(input.length() / 2);
        byte[] buffer = new byte[1024];
        while (!deflater.finished()) {
          int bytesDeflated = deflater.deflate(buffer);
          compressedBytesStream.write(buffer, 0, bytesDeflated);
        }
        return compressedBytesStream.toByteArraySequence();
      }
      finally {
        deflater.end();
      }
    }
@Override
    public ByteArraySequence compress(@NotNull ByteArraySequence input, boolean mayReturnReusableBufferHint)