Top Description Fields Constructors Methods
net.jpountz.lz4

pack-priv final Class LZ4JNICompressor

extends LZ4Compressor
Class Inheritance
Static Imports
net.jpountz.util.ByteBufferUtils.checkNotReadOnly, .ByteBufferUtils.checkRange, .SafeUtils.checkRange

Fast LZ4FastCompressors implemented with JNI bindings to the original C implementation of LZ4.

Field Summary

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

Constructor Summary

AccessConstructor and Description
pack-priv

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

INSTANCEback to summary
public static final LZ4Compressor INSTANCE
SAFE_INSTANCEback to summary
private static LZ4Compressor SAFE_INSTANCE

Constructor Detail

LZ4JNICompressorback to summary
pack-priv LZ4JNICompressor()

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