public class LzopDecompressor extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
LzoDecompressor.CompressionStrategy |
| Modifier and Type | Field and Description |
|---|---|
static int |
LZO_LIBRARY_VERSION |
static int |
MINIMUM_LZO_VERSION
The minimum version of LZO that we can read.
|
| Constructor and Description |
|---|
LzopDecompressor(int bufferSize)
Create an LzoDecompressor with LZO1X strategy (the only lzo algorithm
supported by lzop).
|
| Modifier and Type | Method and Description |
|---|---|
int |
decompress(byte[] b,
int off,
int len) |
void |
end() |
protected void |
finalize() |
boolean |
finished() |
int |
getChecksumsCount()
Get the number of checksum implementations
the current lzo file uses.
|
int |
getCompressedChecksumsCount()
Get the number of compressed checksum implementations
the current lzo file uses.
|
int |
getDecompressedChecksumsCount()
Get the number of decompressed checksum implementations
the current lzo file uses.
|
int |
getRemaining() |
void |
initHeaderFlags(EnumSet<DChecksum> dflags,
EnumSet<CChecksum> cflags)
Given a set of decompressed and compressed checksums,
|
protected boolean |
isCurrentBlockUncompressed()
Query the compression status of the current block as it exists
in the file.
|
static boolean |
isNativeLzoLoaded()
Check if lzo decompressors are loaded and initialized.
|
boolean |
needsDictionary() |
boolean |
needsInput() |
void |
reset() |
void |
resetChecksum()
Reset all checksums registered for this decompressor instance.
|
void |
setCurrentBlockUncompressed(boolean uncompressed)
Note whether the current block being decompressed is actually
stored as uncompressed data.
|
void |
setDictionary(byte[] b,
int off,
int len) |
void |
setInput(byte[] b,
int off,
int len) |
boolean |
verifyCChecksum(CChecksum typ,
int checksum)
Given a checksum type, verity its value against that observed in
compressed data.
|
boolean |
verifyDChecksum(DChecksum typ,
int checksum)
Given a checksum type, verify its value against that observed in
decompressed data.
|
public static int MINIMUM_LZO_VERSION
public static final int LZO_LIBRARY_VERSION
public LzopDecompressor(int bufferSize)
bufferSize - The buffer sizepublic void initHeaderFlags(EnumSet<DChecksum> dflags, EnumSet<CChecksum> cflags)
dflags - The decompressed flagscflags - The compressed flagspublic int getChecksumsCount()
public int getCompressedChecksumsCount()
public int getDecompressedChecksumsCount()
public void resetChecksum()
public boolean verifyDChecksum(DChecksum typ, int checksum)
typ - The checksum typechecksum - The checksum of decompressed datapublic boolean verifyCChecksum(CChecksum typ, int checksum)
typ - The checksum typechecksum - The checksum of compressed datapublic void setInput(byte[] b,
int off,
int len)
setInput in interface org.apache.hadoop.io.compress.Decompressorpublic int decompress(byte[] b,
int off,
int len)
throws IOException
decompress in interface org.apache.hadoop.io.compress.DecompressorIOExceptionpublic static boolean isNativeLzoLoaded()
true if lzo decompressors are loaded and initialized,
else falsepublic void setDictionary(byte[] b,
int off,
int len)
setDictionary in interface org.apache.hadoop.io.compress.Decompressorpublic boolean needsInput()
needsInput in interface org.apache.hadoop.io.compress.Decompressorpublic boolean needsDictionary()
needsDictionary in interface org.apache.hadoop.io.compress.Decompressorpublic boolean finished()
finished in interface org.apache.hadoop.io.compress.Decompressorpublic void reset()
reset in interface org.apache.hadoop.io.compress.Decompressorpublic void end()
end in interface org.apache.hadoop.io.compress.Decompressorpublic int getRemaining()
getRemaining in interface org.apache.hadoop.io.compress.Decompressorpublic void setCurrentBlockUncompressed(boolean uncompressed)
uncompressed - Whether the current block of data is uncompressed already.protected boolean isCurrentBlockUncompressed()
Copyright © 2016. All Rights Reserved.