org.elasticsearch.common.compress.lzf
Class ChunkEncoder

java.lang.Object
  extended by org.elasticsearch.common.compress.lzf.ChunkEncoder

public class ChunkEncoder
extends java.lang.Object

Class that handles actual encoding of individual chunks. Resulting chunks can be compressed or non-compressed; compression is only used if it actually reduces chunk size (including overhead of additional header bytes)


Constructor Summary
ChunkEncoder(int totalLength)
           
 
Method Summary
 LZFChunk encodeChunk(byte[] data, int offset, int len)
          Method for compressing (or not) individual chunks
 int encodeChunk(java.io.OutputStream os, byte[] data, int offset, int len)
          Method for compressing (or not) individual chunks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChunkEncoder

public ChunkEncoder(int totalLength)
Parameters:
totalLength - Total encoded length; used for calculating size of hash table to use
Method Detail

encodeChunk

public int encodeChunk(java.io.OutputStream os,
                       byte[] data,
                       int offset,
                       int len)
                throws java.io.IOException
Method for compressing (or not) individual chunks

Throws:
java.io.IOException

encodeChunk

public LZFChunk encodeChunk(byte[] data,
                            int offset,
                            int len)
Method for compressing (or not) individual chunks