From 428d056ddcf2e1bb7f170a5f0a403763ecda7d1d Mon Sep 17 00:00:00 2001 From: Aayush Atharva Date: Thu, 28 Dec 2023 22:19:02 +0530 Subject: [PATCH] Fix Encoder bug --- java/org/brotli/wrapper/enc/Encoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/org/brotli/wrapper/enc/Encoder.java b/java/org/brotli/wrapper/enc/Encoder.java index 256713c..4071c9c 100644 --- a/java/org/brotli/wrapper/enc/Encoder.java +++ b/java/org/brotli/wrapper/enc/Encoder.java @@ -227,7 +227,7 @@ public class Encoder { int totalOutputSize = 0; try { encoder.getInputBuffer().put(data, offset, length); - encoder.push(EncoderJNI.Operation.FINISH, data.length); + encoder.push(EncoderJNI.Operation.FINISH, length); while (true) { if (!encoder.isSuccess()) { throw new IOException("encoding failed");