com.bigdata.io.compression
Interface IRecordCompressor

All Known Implementing Classes:
NOPRecordCompressor, RecordCompressor

public interface IRecordCompressor

Interface for record-level compression.

Version:
$Id: IRecordCompressor.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

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.
 

Method Detail

compress

void compress(ByteBuffer bin,
              OutputStream os)
Compresses data onto the output stream.

Parameters:
bin - 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.

compress

void compress(byte[] bytes,
              OutputStream os)
Compresses data onto the output stream.

Parameters:
bytes - The data.
os - The stream onto which the compressed data are written.

compress

void compress(byte[] bytes,
              int off,
              int len,
              OutputStream os)
Compresses data onto the output stream.

Parameters:
bytes - 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.

decompress

ByteBuffer decompress(ByteBuffer bin)
Decompress a ByteBuffer containing the record and return the uncompressed state.

Parameters:
bin - The compressed data.
Returns:
A view onto a shared buffer. The data between position() and limit() are the decompressed data. The contents of this buffer are valid only until the next compression or decompression request.

decompress

ByteBuffer decompress(byte[] bin)
Decompress a byte[] containing the record and return the uncompressed state.

Parameters:
bin - The compressed data.
Returns:
A read-only view onto a shared buffer. The data between position() and limit() are the decompressed data. The contents of this buffer are valid only until the next compression or decompression request. The position will be zero. The limit will be the #of decompressed bytes.


Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.