org.elasticsearch.common.compress.lzf
Class LZFDecoder

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

public class LZFDecoder
extends java.lang.Object

Decoder that handles decoding of sequence of encoded LZF chunks, combining them into a single contiguous result byte array


Method Summary
static byte[] decode(byte[] sourceBuffer)
           
static int decode(byte[] sourceBuffer, byte[] targetBuffer)
          Method for decompressing whole input data, which encoded in LZF block structure (compatible with lzf command line utility), and can consist of any number of blocks
static void decompressChunk(byte[] in, int inPos, byte[] out, int outPos, int outEnd)
          Main decode method for individual chunks.
static int decompressChunk(java.io.InputStream is, byte[] inputBuffer, byte[] outputBuffer)
          Main decode from a stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

decode

public static byte[] decode(byte[] sourceBuffer)
                     throws java.io.IOException
Throws:
java.io.IOException

decode

public static int decode(byte[] sourceBuffer,
                         byte[] targetBuffer)
                  throws java.io.IOException
Method for decompressing whole input data, which encoded in LZF block structure (compatible with lzf command line utility), and can consist of any number of blocks

Throws:
java.io.IOException

decompressChunk

public static int decompressChunk(java.io.InputStream is,
                                  byte[] inputBuffer,
                                  byte[] outputBuffer)
                           throws java.io.IOException
Main decode from a stream. Decompressed bytes are placed in the outputBuffer, inputBuffer is a "scratch-area".

Parameters:
is - An input stream of LZF compressed bytes
inputBuffer - A byte array used as a scratch area.
outputBuffer - A byte array in which the result is returned
Returns:
The number of bytes placed in the outputBuffer.
Throws:
java.io.IOException

decompressChunk

public static void decompressChunk(byte[] in,
                                   int inPos,
                                   byte[] out,
                                   int outPos,
                                   int outEnd)
                            throws java.io.IOException
Main decode method for individual chunks.

Throws:
java.io.IOException