public class Lz4BlockCompressor extends Object implements BlockCompressor
This class is copied and modified from LZ4BlockOutputStream.
| Constructor and Description |
|---|
Lz4BlockCompressor() |
| Modifier and Type | Method and Description |
|---|---|
int |
compress(byte[] src,
int srcOff,
int srcLen,
byte[] dst,
int dstOff)
Compress data read from src, and write the compressed data to dst.
|
int |
compress(ByteBuffer src,
int srcOff,
int srcLen,
ByteBuffer dst,
int dstOff)
Compress source data read from (
Buffer.position() + srcOff),
and write the compressed data to dst. |
int |
getMaxCompressedSize(int srcSize)
Get the max compressed size for a given original size.
|
public int getMaxCompressedSize(int srcSize)
BlockCompressorgetMaxCompressedSize in interface BlockCompressorpublic int compress(ByteBuffer src, int srcOff, int srcLen, ByteBuffer dst, int dstOff) throws InsufficientBufferException
BlockCompressorBuffer.position() + srcOff),
and write the compressed data to dst.compress in interface BlockCompressorsrc - Uncompressed data to read fromsrcOff - The start offset of uncompressed datasrcLen - The length of data which want to be compresseddst - The target to write compressed datadstOff - The start offset to write the compressed dataInsufficientBufferException - if the target does not have sufficient spacepublic int compress(byte[] src,
int srcOff,
int srcLen,
byte[] dst,
int dstOff)
throws InsufficientBufferException
BlockCompressorcompress in interface BlockCompressorsrc - Uncompressed data to read fromsrcOff - The start offset of uncompressed datasrcLen - The length of data which want to be compresseddst - The target to write compressed datadstOff - The start offset to write the compressed dataInsufficientBufferException - if the target does not have sufficient spaceCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.