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 CompressorCodec
public final byte[] compress(byte[] input, int inputLength)
compress
in interface CompressorCodec
public final int compress(byte[] input, int inputLength, byte[] output, int maxOutputLength) throws MalformedInputException
compress
in interface CompressorCodec
MalformedInputException
public final long compress(File input, File output) throws MalformedInputException
CompressorCodec
compress
in interface CompressorCodec
MalformedInputException
public final byte[] decompress(byte[] compressed, int length) throws MalformedInputException
decompress
in interface CompressorCodec
MalformedInputException
public final int decompress(byte[] input, int inputLength, byte[] output, int maxOutputLength) throws MalformedInputException
decompress
in interface CompressorCodec
MalformedInputException
public final long decompress(File input, File output) throws MalformedInputException
CompressorCodec
decompress
in interface CompressorCodec
MalformedInputException
public final int getDecompressedSize(byte[] compressed, int length)
getDecompressedSize
in interface CompressorCodec
public void initializeCodecForStream(int defaultBlockSize)
defaultBlockSize
- public void writeForCompression(byte[] uncompressed) throws IOException
uncompressed
- IOException
public void writeForCompression(io.netty.buffer.ByteBuf uncompressed) throws IOException
uncompressed
- IOException
public void writeForDecompression(byte[] compressed) throws IOException
compressed
- IOException
public void writeForDecompression(io.netty.buffer.ByteBuf compressed) throws IOException
compressed
- IOException
public byte[] readCodec()
public byte[] finishCodec() throws IOException
IOException
Copyright © 2009–2022 Waarp. All rights reserved.