public class LzoCompressor extends Object implements org.apache.hadoop.io.compress.Compressor
Compressor
based on the lzo algorithm.
http://www.oberhumer.com/opensource/lzo/Modifier and Type | Class and Description |
---|---|
static class |
LzoCompressor.CompressionStrategy
The compression algorithm for lzo library.
|
Constructor and Description |
---|
LzoCompressor()
Creates a new compressor with the default lzo1x_1 compression.
|
LzoCompressor(LzoCompressor.CompressionStrategy strategy,
int outputBufferSize)
Creates a new compressor using the specified
LzoCompressor.CompressionStrategy . |
Modifier and Type | Method and Description |
---|---|
int |
compress(byte[] b,
int off,
int len) |
void |
end()
Noop.
|
void |
finish() |
boolean |
finished() |
long |
getBytesRead()
Return number of bytes given to this compressor since last reset.
|
long |
getBytesWritten()
Return number of bytes consumed by callers of compress since last reset.
|
boolean |
needsInput() |
void |
reinit(org.apache.hadoop.conf.Configuration conf) |
void |
reset() |
void |
setDictionary(byte[] b,
int off,
int len) |
void |
setInput(byte[] b,
int off,
int len)
WARNING: This method retains a pointer to the user's buffer.
|
public LzoCompressor(LzoCompressor.CompressionStrategy strategy, int outputBufferSize)
LzoCompressor.CompressionStrategy
.strategy
- lzo compression algorithm to useoutputBufferSize
- size of the output buffer to be used.public LzoCompressor()
public void setInput(byte[] b, int off, int len)
setInput
in interface org.apache.hadoop.io.compress.Compressor
public void setDictionary(byte[] b, int off, int len)
setDictionary
in interface org.apache.hadoop.io.compress.Compressor
public boolean needsInput()
needsInput
in interface org.apache.hadoop.io.compress.Compressor
public void finish()
finish
in interface org.apache.hadoop.io.compress.Compressor
public boolean finished()
finished
in interface org.apache.hadoop.io.compress.Compressor
public int compress(byte[] b, int off, int len) throws IOException
compress
in interface org.apache.hadoop.io.compress.Compressor
IOException
public void reset()
reset
in interface org.apache.hadoop.io.compress.Compressor
public void reinit(org.apache.hadoop.conf.Configuration conf)
reinit
in interface org.apache.hadoop.io.compress.Compressor
public long getBytesRead()
getBytesRead
in interface org.apache.hadoop.io.compress.Compressor
public long getBytesWritten()
getBytesWritten
in interface org.apache.hadoop.io.compress.Compressor
public void end()
end
in interface org.apache.hadoop.io.compress.Compressor