
public class ZlibCodec extends Object implements CompressorCodec
| Constructor and Description |
|---|
ZlibCodec() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
compress(byte[] input,
int inputLength) |
int |
compress(byte[] input,
int inputLength,
byte[] output,
int maxOutputLength) |
long |
compress(File input,
File output)
Compress the file input to the file output
|
byte[] |
decompress(byte[] compressed,
int length) |
int |
decompress(byte[] input,
int inputLength,
byte[] output,
int maxOutputLength) |
long |
decompress(File input,
File output)
Decompress the file input to the file output
|
byte[] |
finishCodec()
Finish the CoDec operation.
|
int |
getDecompressedSize(byte[] compressed,
int length) |
void |
initializeCodecForStream(int defaultBlockSize)
Allow to specify a block size for CoDec
|
int |
maxCompressedLength(int uncompressedSize) |
byte[] |
readCodec() |
void |
writeForCompression(byte[] uncompressed)
Write an uncompressed data for compression
|
void |
writeForCompression(io.netty.buffer.ByteBuf uncompressed)
Write an uncompressed data for compression
|
void |
writeForDecompression(byte[] compressed)
Write a compressed data for decompression
|
void |
writeForDecompression(io.netty.buffer.ByteBuf compressed)
Write a compressed data for decompression
|
public final int maxCompressedLength(int uncompressedSize)
maxCompressedLength in interface CompressorCodecpublic final byte[] compress(byte[] input,
int inputLength)
compress in interface CompressorCodecpublic final int compress(byte[] input,
int inputLength,
byte[] output,
int maxOutputLength)
throws MalformedInputException
compress in interface CompressorCodecMalformedInputExceptionpublic final long compress(File input, File output) throws MalformedInputException
CompressorCodeccompress in interface CompressorCodecMalformedInputExceptionpublic final byte[] decompress(byte[] compressed,
int length)
throws MalformedInputException
decompress in interface CompressorCodecMalformedInputExceptionpublic final int decompress(byte[] input,
int inputLength,
byte[] output,
int maxOutputLength)
throws MalformedInputException
decompress in interface CompressorCodecMalformedInputExceptionpublic final long decompress(File input, File output) throws MalformedInputException
CompressorCodecdecompress in interface CompressorCodecMalformedInputExceptionpublic final int getDecompressedSize(byte[] compressed,
int length)
getDecompressedSize in interface CompressorCodecpublic void initializeCodecForStream(int defaultBlockSize)
defaultBlockSize - public void writeForCompression(byte[] uncompressed)
throws IOException
uncompressed - IOExceptionpublic void writeForCompression(io.netty.buffer.ByteBuf uncompressed)
throws IOException
uncompressed - IOExceptionpublic void writeForDecompression(byte[] compressed)
throws IOException
compressed - IOExceptionpublic void writeForDecompression(io.netty.buffer.ByteBuf compressed)
throws IOException
compressed - IOExceptionpublic byte[] readCodec()
public byte[] finishCodec()
throws IOException
IOExceptionCopyright © 2009–2022 Waarp. All rights reserved.