org.elasticsearch.common.compress.snappy
Class SnappyCompressor

java.lang.Object
  extended by org.elasticsearch.common.compress.snappy.SnappyCompressor
All Implemented Interfaces:
Compressor
Direct Known Subclasses:
UnavailableSnappyCompressor, XerialSnappyCompressor

public abstract class SnappyCompressor
extends Object
implements Compressor


Field Summary
protected  SnappyCompressorContext compressorContext
           
static byte[] HEADER
           
 
Constructor Summary
protected SnappyCompressor()
           
 
Method Summary
 byte[] compress(byte[] data, int offset, int length)
          Compresses the provided data, data can be detected as compressed using Compressor.isCompressed(byte[], int, int).
 void configure(Settings settings)
           
 boolean isCompressed(byte[] data, int offset, int length)
           
 boolean isCompressed(BytesReference bytes)
           
 boolean isCompressed(org.jboss.netty.buffer.ChannelBuffer buffer)
           
 boolean isCompressed(org.apache.lucene.store.IndexInput in)
           
protected abstract  int maxCompressedLength(int length)
           
 byte[] uncompress(byte[] data, int offset, int length)
          Uncompress the provided data, data can be detected as compressed using Compressor.isCompressed(byte[], int, int).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.elasticsearch.common.compress.Compressor
indexInput, indexOutput, streamInput, streamOutput, type
 

Field Detail

HEADER

public static final byte[] HEADER

compressorContext

protected SnappyCompressorContext compressorContext
Constructor Detail

SnappyCompressor

protected SnappyCompressor()
Method Detail

configure

public void configure(Settings settings)
Specified by:
configure in interface Compressor

maxCompressedLength

protected abstract int maxCompressedLength(int length)

isCompressed

public boolean isCompressed(byte[] data,
                            int offset,
                            int length)
Specified by:
isCompressed in interface Compressor

isCompressed

public boolean isCompressed(BytesReference bytes)
Specified by:
isCompressed in interface Compressor

isCompressed

public boolean isCompressed(org.jboss.netty.buffer.ChannelBuffer buffer)
Specified by:
isCompressed in interface Compressor

isCompressed

public boolean isCompressed(org.apache.lucene.store.IndexInput in)
                     throws IOException
Specified by:
isCompressed in interface Compressor
Throws:
IOException

compress

public byte[] compress(byte[] data,
                       int offset,
                       int length)
                throws IOException
Description copied from interface: Compressor
Compresses the provided data, data can be detected as compressed using Compressor.isCompressed(byte[], int, int).

Specified by:
compress in interface Compressor
Throws:
IOException

uncompress

public byte[] uncompress(byte[] data,
                         int offset,
                         int length)
                  throws IOException
Description copied from interface: Compressor
Uncompress the provided data, data can be detected as compressed using Compressor.isCompressed(byte[], int, int).

Specified by:
uncompress in interface Compressor
Throws:
IOException


Copyright © 2009-2012. All Rights Reserved.