| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.io.compress.lzo.LzoCompressor
public class LzoCompressor
A Compressor based on the lzo algorithm.
 http://www.oberhumer.com/opensource/lzo/
| Nested Class Summary | |
|---|---|
static class | 
LzoCompressor.CompressionStrategy
The compression algorithm for lzo library.  | 
| Constructor Summary | |
|---|---|
LzoCompressor()
Creates a new compressor with the default lzo1x_1 compression.  | 
|
LzoCompressor(LzoCompressor.CompressionStrategy strategy,
              int directBufferSize)
Creates a new compressor using the specified LzoCompressor.CompressionStrategy. | 
|
| Method Summary | |
|---|---|
 int | 
compress(byte[] b,
         int off,
         int len)
Fills specified buffer with compressed data.  | 
 void | 
end()
Noop.  | 
 void | 
finish()
When called, indicates that compression should end with the current contents of the input buffer.  | 
 boolean | 
finished()
Returns true if the end of the compressed data output stream has been reached.  | 
 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.  | 
static boolean | 
isNativeLzoLoaded()
Check if lzo compressors are loaded and initialized.  | 
 boolean | 
needsInput()
Returns true if the input data buffer is empty and #setInput() should be called to provide more input.  | 
 void | 
reset()
Resets compressor so that a new set of input data can be processed.  | 
 void | 
setDictionary(byte[] b,
              int off,
              int len)
Sets preset dictionary for compression.  | 
 void | 
setInput(byte[] b,
         int off,
         int len)
Sets input data for compression.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public LzoCompressor(LzoCompressor.CompressionStrategy strategy,
                     int directBufferSize)
LzoCompressor.CompressionStrategy.
strategy - lzo compression algorithm to usedirectBufferSize - size of the direct buffer to be used.public LzoCompressor()
| Method Detail | 
|---|
public static boolean isNativeLzoLoaded()
true if lzo compressors are loaded & initialized,
         else false
public void setInput(byte[] b,
                     int off,
                     int len)
Compressortrue indicating that more input data is required.
setInput in interface Compressorb - Input dataoff - Start offsetlen - Length
public void setDictionary(byte[] b,
                          int off,
                          int len)
Compressor
setDictionary in interface Compressorb - Dictionary data bytesoff - Start offsetlen - Lengthpublic boolean needsInput()
needsInput in interface Compressortrue if the input data buffer is empty and 
 #setInput() should be called in order to provide more input.public void finish()
Compressor
finish in interface Compressorpublic boolean finished()
Compressor
finished in interface Compressortrue if the end of the compressed
 data output stream has been reached.
public int compress(byte[] b,
                    int off,
                    int len)
             throws IOException
Compressor
compress in interface Compressorb - Buffer for the compressed dataoff - Start offset of the datalen - Size of the buffer
IOExceptionpublic void reset()
Compressor
reset in interface Compressorpublic long getBytesRead()
getBytesRead in interface Compressorpublic long getBytesWritten()
getBytesWritten in interface Compressorpublic void end()
end in interface Compressor
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||