Top Description Fields Constructors Methods
net.jpountz.lz4

pack-priv final Class LZ4HCJNICompressor

extends LZ4Compressor
Class Inheritance
Static Imports
net.jpountz.lz4.LZ4Constants.DEFAULT_COMPRESSION_LEVEL

High compression LZ4Compressors implemented with JNI bindings to the original C implementation of LZ4.

Field Summary

Modifier and TypeField and Description
private final int
public static final LZ4HCJNICompressor
private static LZ4Compressor

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
LZ4HCJNICompressor(int compressionLevel)

Method Summary

Modifier and TypeMethod and Description
public int
compress(byte[] src, int srcOff, int srcLen, byte[] dest, int destOff, int maxDestLen)

Implements abstract net.jpountz.lz4.LZ4Compressor.compress.

Compress src[srcOff:srcOff+srcLen] into dest[destOff:destOff+destLen] and return the compressed length.
public int
compress(ByteBuffer src, int srcOff, int srcLen, ByteBuffer dest, int destOff, int maxDestLen)

Implements abstract net.jpountz.lz4.LZ4Compressor.compress.

Compress src[srcOff:srcOff+srcLen] into dest[destOff:destOff+destLen] and return the compressed length.
Inherited from net.jpountz.lz4.LZ4Compressor:
compresscompresscompresscompresscompressmaxCompressedLengthtoString

Field Detail

compressionLevelback to summary
private final int compressionLevel
INSTANCEback to summary
public static final LZ4HCJNICompressor INSTANCE
SAFE_INSTANCEback to summary
private static LZ4Compressor SAFE_INSTANCE

Constructor Detail

LZ4HCJNICompressorback to summary
pack-priv LZ4HCJNICompressor()
LZ4HCJNICompressorback to summary
pack-priv LZ4HCJNICompressor(int compressionLevel)

Method Detail

compressback to summary
public int compress(byte[] src, int srcOff, int srcLen, byte[] dest, int destOff, int maxDestLen)

Implements abstract net.jpountz.lz4.LZ4Compressor.compress.

Doc from net.jpountz.lz4.LZ4Compressor.compress.

Compress src[srcOff:srcOff+srcLen] into dest[destOff:destOff+destLen] and return the compressed length. This method will throw a LZ4Exception if this compressor is unable to compress the input into less than maxDestLen bytes. To prevent this exception to be thrown, you should make sure that maxDestLen >= maxCompressedLength(srcLen).

Returns:int

the compressed size

Annotations
@Override
compressback to summary
public int compress(ByteBuffer src, int srcOff, int srcLen, ByteBuffer dest, int destOff, int maxDestLen)

Implements abstract net.jpountz.lz4.LZ4Compressor.compress.

Doc from net.jpountz.lz4.LZ4Compressor.compress.

Compress src[srcOff:srcOff+srcLen] into dest[destOff:destOff+destLen] and return the compressed length. This method will throw a LZ4Exception if this compressor is unable to compress the input into less than maxDestLen bytes. To prevent this exception to be thrown, you should make sure that maxDestLen >= maxCompressedLength(srcLen). ByteBuffer positions remain unchanged.

Returns:int

the compressed size

Annotations
@Override