public abstract class NonBlockedCompressor extends Object implements org.apache.hadoop.io.compress.Compressor
| Constructor and Description |
|---|
NonBlockedCompressor() |
| Modifier and Type | Method and Description |
|---|---|
int |
compress(byte[] buffer,
int off,
int len)
Fills specified buffer with compressed data.
|
protected abstract int |
compress(ByteBuffer uncompressed,
ByteBuffer compressed)
Compress the content in the given input buffer.
|
void |
end() |
void |
finish() |
boolean |
finished() |
long |
getBytesRead() |
long |
getBytesWritten() |
protected abstract int |
maxCompressedLength(int byteSize)
Get the maximum byte size needed for compressing data of the given byte
size.
|
boolean |
needsInput() |
void |
reinit(org.apache.hadoop.conf.Configuration c) |
void |
reset() |
void |
setDictionary(byte[] dictionary,
int off,
int len) |
void |
setInput(byte[] buffer,
int off,
int len) |
public int compress(byte[] buffer,
int off,
int len)
throws IOException
compress in interface org.apache.hadoop.io.compress.Compressorbuffer - Buffer for the compressed dataoff - Start offset of the datalen - Size of the bufferIOExceptionpublic void setInput(byte[] buffer,
int off,
int len)
setInput in interface org.apache.hadoop.io.compress.Compressorpublic void end()
end in interface org.apache.hadoop.io.compress.Compressorpublic void finish()
finish in interface org.apache.hadoop.io.compress.Compressorpublic boolean finished()
finished in interface org.apache.hadoop.io.compress.Compressorpublic long getBytesRead()
getBytesRead in interface org.apache.hadoop.io.compress.Compressorpublic long getBytesWritten()
getBytesWritten in interface org.apache.hadoop.io.compress.Compressorpublic boolean needsInput()
needsInput in interface org.apache.hadoop.io.compress.Compressorpublic void reinit(org.apache.hadoop.conf.Configuration c)
reinit in interface org.apache.hadoop.io.compress.Compressorpublic void reset()
reset in interface org.apache.hadoop.io.compress.Compressorpublic void setDictionary(byte[] dictionary,
int off,
int len)
setDictionary in interface org.apache.hadoop.io.compress.Compressorprotected abstract int maxCompressedLength(int byteSize)
byteSize - byte size of the data to compressprotected abstract int compress(ByteBuffer uncompressed, ByteBuffer compressed) throws IOException
uncompressed - buffer[pos() ... limit()) containing the input datacompressed - output of the compressed data. Uses range [pos()..].IOExceptionCopyright © 2023 The Apache Software Foundation. All rights reserved.