org.elasticsearch.common.compress.lzf
Class LZFChunk

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

public class LZFChunk
extends java.lang.Object

Helper class used to store LZF encoded segments (compressed and non-compressed) that can be sequenced to produce LZF files/streams.


Field Summary
static int BLOCK_TYPE_COMPRESSED
           
static int BLOCK_TYPE_NON_COMPRESSED
           
static byte BYTE_V
           
static byte BYTE_Z
           
static int MAX_CHUNK_LEN
           
static int MAX_LITERAL
          Maximum length of literal run for LZF encoding.
 
Method Summary
 int copyTo(byte[] dst, int ptr)
           
static LZFChunk createCompressed(int origLen, byte[] encData, int encPtr, int encLen)
          Factory method for constructing compressed chunk
static int createCompressed(java.io.OutputStream os, int origLen, byte[] encData, int encPtr, int encLen)
           
static LZFChunk createNonCompressed(byte[] plainData, int ptr, int len)
          Factory method for constructing compressed chunk
static int createNonCompressed(java.io.OutputStream os, byte[] plainData, int ptr, int len)
           
 byte[] getData()
           
 int length()
           
 LZFChunk next()
           
 void setNext(LZFChunk next)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_LITERAL

public static final int MAX_LITERAL
Maximum length of literal run for LZF encoding.

See Also:
Constant Field Values

MAX_CHUNK_LEN

public static final int MAX_CHUNK_LEN
See Also:
Constant Field Values

BYTE_Z

public static final byte BYTE_Z
See Also:
Constant Field Values

BYTE_V

public static final byte BYTE_V
See Also:
Constant Field Values

BLOCK_TYPE_NON_COMPRESSED

public static final int BLOCK_TYPE_NON_COMPRESSED
See Also:
Constant Field Values

BLOCK_TYPE_COMPRESSED

public static final int BLOCK_TYPE_COMPRESSED
See Also:
Constant Field Values
Method Detail

createCompressed

public static int createCompressed(java.io.OutputStream os,
                                   int origLen,
                                   byte[] encData,
                                   int encPtr,
                                   int encLen)
                            throws java.io.IOException
Throws:
java.io.IOException

createCompressed

public static LZFChunk createCompressed(int origLen,
                                        byte[] encData,
                                        int encPtr,
                                        int encLen)
Factory method for constructing compressed chunk


createNonCompressed

public static int createNonCompressed(java.io.OutputStream os,
                                      byte[] plainData,
                                      int ptr,
                                      int len)
                               throws java.io.IOException
Throws:
java.io.IOException

createNonCompressed

public static LZFChunk createNonCompressed(byte[] plainData,
                                           int ptr,
                                           int len)
Factory method for constructing compressed chunk


setNext

public void setNext(LZFChunk next)

next

public LZFChunk next()

length

public int length()

getData

public byte[] getData()

copyTo

public int copyTo(byte[] dst,
                  int ptr)