public class LZ4DecompressorWithLength
extends java.lang.Object
LZ4CompressorWithLength
.
This decompressor is NOT compatible with any other compressors in lz4-java
or any other lz4 tools.
The user does not need to specify the length of the compressed data or
original data because the length of the original decompressed data is
included in the compressed data.Constructor and Description |
---|
LZ4DecompressorWithLength(LZ4FastDecompressor decompressor)
Creates a new decompressor to decompress data compressed by
LZ4CompressorWithLength . |
Modifier and Type | Method and Description |
---|---|
byte[] |
decompress(byte[] src)
Convenience method, equivalent to calling
decompress(src, 0) . |
int |
decompress(byte[] src,
byte[] dest)
Convenience method, equivalent to calling
decompress(src, 0, dest, 0) . |
byte[] |
decompress(byte[] src,
int srcOff)
Convenience method which returns
src[srcOff:]
decompressed. |
int |
decompress(byte[] src,
int srcOff,
byte[] dest,
int destOff)
Decompresses
src[srcOff:] into dest[destOff:]
and returns the number of bytes read from src . |
void |
decompress(java.nio.ByteBuffer src,
java.nio.ByteBuffer dest)
Decompresses
src into dest . |
int |
decompress(java.nio.ByteBuffer src,
int srcOff,
java.nio.ByteBuffer dest,
int destOff)
Decompresses
src[srcOff:] into dest[destOff:]
and returns the number of bytes read from src . |
static int |
getDecompressedLength(byte[] src)
Returns the decompressed length of compressed data in
src . |
static int |
getDecompressedLength(byte[] src,
int srcOff)
Returns the decompressed length of compressed data in
src[srcOff:] . |
static int |
getDecompressedLength(java.nio.ByteBuffer src)
Returns the decompressed length of compressed data in
src . |
static int |
getDecompressedLength(java.nio.ByteBuffer src,
int srcOff)
Returns the decompressed length of compressed data in
src[srcOff:] . |
public LZ4DecompressorWithLength(LZ4FastDecompressor decompressor)
LZ4CompressorWithLength
.decompressor
- decompressor to usepublic static int getDecompressedLength(byte[] src)
src
.src
- the compressed datapublic static int getDecompressedLength(byte[] src, int srcOff)
src[srcOff:]
.src
- the compressed datasrcOff
- the start offset in srcpublic static int getDecompressedLength(java.nio.ByteBuffer src)
src
.src
- the compressed datapublic static int getDecompressedLength(java.nio.ByteBuffer src, int srcOff)
src[srcOff:]
.src
- the compressed datasrcOff
- the start offset in srcpublic int decompress(byte[] src, byte[] dest)
decompress(src, 0, dest, 0)
.src
- the compressed datadest
- the destination buffer to store the decompressed datapublic int decompress(byte[] src, int srcOff, byte[] dest, int destOff)
src[srcOff:]
into dest[destOff:]
and returns the number of bytes read from src
.src
- the compressed datasrcOff
- the start offset in srcdest
- the destination buffer to store the decompressed datadestOff
- the start offset in destpublic byte[] decompress(byte[] src)
decompress(src, 0)
.src
- the compressed datapublic byte[] decompress(byte[] src, int srcOff)
src[srcOff:]
decompressed.
Warning: this method has an important overhead due to the fact that it needs to allocate a buffer to decompress into.
src
- the compressed datasrcOff
- the start offset in srcpublic void decompress(java.nio.ByteBuffer src, java.nio.ByteBuffer dest)
src
into dest
. This method moves the positions of the buffers.src
- the compressed datadest
- the destination buffer to store the decompressed datapublic int decompress(java.nio.ByteBuffer src, int srcOff, java.nio.ByteBuffer dest, int destOff)
src[srcOff:]
into dest[destOff:]
and returns the number of bytes read from src
.
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 dest