|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.io.compression.RecordCompressor
public class RecordCompressor
Bulk data (de-)compressor used for leaves in IndexSegments. The
compression and decompression operations of a given RecordCompressor
reuse a shared instance buffer. Any decompression result is valid only until
the next compression or decompression operation performed by that
RecordCompressor. When used in a single-threaded context this reduces
allocation while maximizing the opportunity for bulk transfers.
This class is NOT thread-safe.
| Constructor Summary | |
|---|---|
RecordCompressor()
De-serialization constructor. |
|
RecordCompressor(int level)
Create a record compressor. |
|
| Method Summary | |
|---|---|
void |
compress(byte[] bytes,
int off,
int len,
OutputStream os)
Compresses data onto the output stream. |
void |
compress(byte[] bytes,
OutputStream os)
Compresses data onto the output stream. |
void |
compress(ByteBuffer bin,
OutputStream os)
Compresses data onto the output stream. |
ByteBuffer |
decompress(byte[] bin)
Decompress a byte[] containing the record and return the
uncompressed state. |
ByteBuffer |
decompress(ByteBuffer bin)
Decompress a ByteBuffer containing the record and return the
uncompressed state. |
protected ByteBuffer |
decompress(InflaterInputStream iis)
This decompresses data into a shared instance byte[]. |
void |
readExternal(ObjectInput in)
|
String |
toString()
|
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RecordCompressor(int level)
level - The compression level.Deflater.BEST_SPEED,
Deflater.BEST_COMPRESSIONpublic RecordCompressor()
| Method Detail |
|---|
public String toString()
toString in class Object
public void compress(ByteBuffer bin,
OutputStream os)
IRecordCompressor
compress in interface IRecordCompressorbin - The data. The data from the position to the limit will be
compressed. The position will be advanced to the limit as a
side effect.os - The stream onto which the compressed data are written.
public void compress(byte[] bytes,
OutputStream os)
IRecordCompressor
compress in interface IRecordCompressorbytes - The data.os - The stream onto which the compressed data are written.
public void compress(byte[] bytes,
int off,
int len,
OutputStream os)
IRecordCompressor
compress in interface IRecordCompressorbytes - The source data.off - The offset of the first source byte that will be compressed
onto the output stream.len - The #of source bytes that will be compressed onto the output
stream.os - The stream onto which the compressed data are written.public ByteBuffer decompress(ByteBuffer bin)
IRecordCompressorByteBuffer containing the record and return the
uncompressed state.
decompress in interface IRecordCompressorbin - The compressed data.
public ByteBuffer decompress(byte[] bin)
IRecordCompressorbyte[] containing the record and return the
uncompressed state.
decompress in interface IRecordCompressorbin - The compressed data.
protected ByteBuffer decompress(InflaterInputStream iis)
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizableIOException
ClassNotFoundException
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizableIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||