public abstract class LZ4FastDecompressor extends java.lang.Object implements LZ4Decompressor
LZ4SafeDecompressor
if you only know the size of the
compressed stream.
From lz4-java 1.6.0, it is deprecated to use a JNI-binding instance
of this class; i.e., an instasnce returned by
LZ4Factory.fastDecompressor()
of LZ4Factory.nativeInstance()
.
Please see LZ4Factory.nativeInstance()
for details.
Instances of this class are thread-safe.
LZ4Factory.nativeInstance()
Constructor and Description |
---|
LZ4FastDecompressor() |
Modifier and Type | Method and Description |
---|---|
int |
decompress(byte[] src,
byte[] dest)
Convenience method, equivalent to calling
decompress(src, dest, dest.length) . |
int |
decompress(byte[] src,
byte[] dest,
int destLen)
Convenience method, equivalent to calling
decompress(src, 0, dest, 0, destLen) . |
byte[] |
decompress(byte[] src,
int destLen)
Convenience method, equivalent to calling
decompress(src, 0, destLen) . |
abstract int |
decompress(byte[] src,
int srcOff,
byte[] dest,
int destOff,
int destLen)
Decompresses
src[srcOff:] into dest[destOff:destOff+destLen]
and returns the number of bytes read from src . |
byte[] |
decompress(byte[] src,
int srcOff,
int destLen)
Convenience method which returns
src[srcOff:?]
decompressed. |
void |
decompress(java.nio.ByteBuffer src,
java.nio.ByteBuffer dest)
Decompresses
src into dest . |
abstract int |
decompress(java.nio.ByteBuffer src,
int srcOff,
java.nio.ByteBuffer dest,
int destOff,
int destLen)
Decompresses
src[srcOff:] into dest[destOff:destOff+destLen]
and returns the number of bytes read from src . |
java.lang.String |
toString() |
public abstract int decompress(byte[] src, int srcOff, byte[] dest, int destOff, int destLen)
src[srcOff:]
into dest[destOff:destOff+destLen]
and returns the number of bytes read from src
.
destLen
must be exactly the size of the decompressed data.decompress
in interface LZ4Decompressor
src
- the compressed datasrcOff
- the start offset in srcdest
- the destination buffer to store the decompressed datadestOff
- the start offset in destdestLen
- the exact size of the original inputpublic abstract int decompress(java.nio.ByteBuffer src, int srcOff, java.nio.ByteBuffer dest, int destOff, int destLen)
src[srcOff:]
into dest[destOff:destOff+destLen]
and returns the number of bytes read from src
.
destLen
must be exactly the size of the decompressed data.
The positions and limits of the ByteBuffer
s remain unchanged.src
- the compressed datasrcOff
- the start offset in srcdest
- the destination buffer to store the decompressed datadestOff
- the start offset in destdestLen
- the exact size of the original inputpublic final int decompress(byte[] src, byte[] dest, int destLen)
decompress(src, 0, dest, 0, destLen)
.src
- the compressed datadest
- the destination buffer to store the decompressed datadestLen
- the exact size of the original inputpublic final int decompress(byte[] src, byte[] dest)
decompress(src, dest, dest.length)
.src
- the compressed datadest
- the destination buffer to store the decompressed datapublic final byte[] decompress(byte[] src, int srcOff, int destLen)
src[srcOff:?]
decompressed.
Warning: this method has an important overhead due to the fact that it needs to allocate a buffer to decompress into.
Here is how this method is implemented:
final byte[] decompressed = new byte[destLen]; decompress(src, srcOff, decompressed, 0, destLen); return decompressed;
src
- the compressed datasrcOff
- the start offset in srcdestLen
- the exact size of the original inputpublic final byte[] decompress(byte[] src, int destLen)
decompress(src, 0, destLen)
.src
- the compressed datadestLen
- the exact size of the original inputpublic final void decompress(java.nio.ByteBuffer src, java.nio.ByteBuffer dest)
src
into dest
. dest
's
Buffer.remaining()
must be exactly the size of the decompressed
data. This method moves the positions of the buffers.src
- the compressed datadest
- the destination buffer to store the decompressed datapublic java.lang.String toString()
toString
in class java.lang.Object