diff --git a/native/src/main/java/com/velocitypowered/natives/compression/NativeVelocityCompressor.java b/native/src/main/java/com/velocitypowered/natives/compression/NativeVelocityCompressor.java index 015c976a1..8e6f59a1c 100644 --- a/native/src/main/java/com/velocitypowered/natives/compression/NativeVelocityCompressor.java +++ b/native/src/main/java/com/velocitypowered/natives/compression/NativeVelocityCompressor.java @@ -56,7 +56,7 @@ public class NativeVelocityCompressor implements VelocityCompressor { int produced = deflate.process(deflateCtx, source.memoryAddress() + source.readerIndex(), source.readableBytes(), destination.memoryAddress() + destination.writerIndex(), destination.writableBytes(), - !source.isReadable()); + true); source.readerIndex(source.readerIndex() + deflate.consumed); destination.writerIndex(destination.writerIndex() + produced); } diff --git a/native/src/test/java/com/velocitypowered/natives/compression/VelocityCompressorTest.java b/native/src/test/java/com/velocitypowered/natives/compression/VelocityCompressorTest.java index 03917e55d..506228c07 100644 --- a/native/src/test/java/com/velocitypowered/natives/compression/VelocityCompressorTest.java +++ b/native/src/test/java/com/velocitypowered/natives/compression/VelocityCompressorTest.java @@ -36,21 +36,21 @@ class VelocityCompressorTest { compressor.dispose(); fail("Loaded regular compressor"); } - check(compressor, () -> Unpooled.directBuffer(TEST_DATA.length)); + check(compressor, () -> Unpooled.directBuffer(TEST_DATA.length + 32)); } @Test void javaIntegrityCheckDirect() throws DataFormatException { VelocityCompressor compressor = JavaVelocityCompressor.FACTORY .create(Deflater.DEFAULT_COMPRESSION); - check(compressor, () -> Unpooled.directBuffer(TEST_DATA.length)); + check(compressor, () -> Unpooled.directBuffer(TEST_DATA.length + 32)); } @Test void javaIntegrityCheckHeap() throws DataFormatException { VelocityCompressor compressor = JavaVelocityCompressor.FACTORY .create(Deflater.DEFAULT_COMPRESSION); - check(compressor, () -> Unpooled.buffer(TEST_DATA.length)); + check(compressor, () -> Unpooled.buffer(TEST_DATA.length + 32)); } private void check(VelocityCompressor compressor, Supplier bufSupplier)