com.bigdata.io.compression
Class NOPRecordCompressor

java.lang.Object
  extended by com.bigdata.io.compression.NOPRecordCompressor
All Implemented Interfaces:
IRecordCompressor, Externalizable, Serializable

public class NOPRecordCompressor
extends Object
implements IRecordCompressor, Externalizable

A compressor that copies bytes without compression them.

Version:
$Id: NOPRecordCompressor.java 2547 2010-03-24 20:44:07Z thompsonbry $
Author:
Bryan Thompson
See Also:
Serialized Form

Field Summary
static NOPRecordCompressor INSTANCE
           
 
Constructor Summary
NOPRecordCompressor()
          (De-)serialization ctor.
 
Method Summary
 void compress(byte[] bytes, int off, int len, OutputStream os)
          Writes the bytes on the output stream.
 void compress(byte[] bytes, OutputStream os)
          Writes the bytes on the output stream.
 void compress(ByteBuffer buf, OutputStream os)
          Writes the buffer on the output stream.
 ByteBuffer decompress(byte[] bin)
          Returns the argument wrapped as a ByteBuffer.
 ByteBuffer decompress(ByteBuffer bin)
          Returns the argument.
 void readExternal(ObjectInput arg0)
          NOP
 void writeExternal(ObjectOutput arg0)
          NOP
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final transient NOPRecordCompressor INSTANCE
Constructor Detail

NOPRecordCompressor

public NOPRecordCompressor()
(De-)serialization ctor.

Method Detail

compress

public void compress(ByteBuffer buf,
                     OutputStream os)
Writes the buffer on the output stream.

Specified by:
compress in interface IRecordCompressor
Parameters:
buf - 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

public void compress(byte[] bytes,
                     OutputStream os)
Writes the bytes on the output stream.

Specified by:
compress in interface IRecordCompressor
Parameters:
bytes - The data.
os - The stream onto which the compressed data are written.

compress

public void compress(byte[] bytes,
                     int off,
                     int len,
                     OutputStream os)
Writes the bytes on the output stream.

Specified by:
compress in interface IRecordCompressor
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

public ByteBuffer decompress(ByteBuffer bin)
Returns the argument.

Specified by:
decompress in interface IRecordCompressor
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

public ByteBuffer decompress(byte[] bin)
Returns the argument wrapped as a ByteBuffer.

Specified by:
decompress in interface IRecordCompressor
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.

readExternal

public void readExternal(ObjectInput arg0)
                  throws IOException,
                         ClassNotFoundException
NOP

Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput arg0)
                   throws IOException
NOP

Specified by:
writeExternal in interface Externalizable
Throws:
IOException


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