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.
protected static int readHeader(java.io.InputStream is, byte[] inputBuffer)
          Helper method to forcibly load header bytes that must be read before chunk can be handled.
 
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".

If no

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

readHeader

protected static int readHeader(java.io.InputStream is,
                                byte[] inputBuffer)
                         throws java.io.IOException
Helper method to forcibly load header bytes that must be read before chunk can be handled.

Throws:
java.io.IOException