Skip to content

Commit

Permalink
Update ClassFileCompressor
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavo committed Dec 24, 2023
1 parent 4e039dd commit a618c87
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package org.glavo.japp.packer.compressor.classfile;

import com.github.luben.zstd.Zstd;
import org.glavo.japp.CompressionMethod;
import org.glavo.japp.packer.compressor.CompressContext;
import org.glavo.japp.util.CompressedNumber;
Expand Down Expand Up @@ -79,10 +78,9 @@ public CompressResult compress(CompressContext context, byte[] source) throws IO

outputBuffer.put(CompressionMethod.ZSTD.id());
int outputPosition = outputBuffer.position();
long compressedTailLen = Zstd.compressByteArray(
long compressedTailLen = context.getZstdCompressCtx().compressByteArray(
output, outputPosition, output.length - outputPosition,
source, reader.tailPosition, reader.tailLen,
8);
source, reader.tailPosition, reader.tailLen);
if (compressedTailLen < reader.tailLen) {
outputBuffer.position(outputPosition + (int) compressedTailLen);
} else {
Expand Down

0 comments on commit a618c87

Please sign in to comment.