org.elasticsearch.common.compress.lzf
Class LZFEncoder

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

public class LZFEncoder
extends java.lang.Object

Encoder that handles splitting of input into chunks to encode, calls ChunkEncoder to compress individual chunks and combines resulting chunks into contiguous output byte array.


Field Summary
static java.lang.ThreadLocal<ThreadLocals.CleanableValue<ChunkEncoder>> cachedEncoder
           
 
Method Summary
static byte[] encode(byte[] data)
           
static byte[] encode(byte[] data, int length)
          Method for compressing given input data using LZF encoding and block structure (compatible with lzf command line utility).
static void encode(java.io.OutputStream os, byte[] data, int length)
           
static byte[] encodeWithCache(byte[] data, int length)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cachedEncoder

public static java.lang.ThreadLocal<ThreadLocals.CleanableValue<ChunkEncoder>> cachedEncoder
Method Detail

encode

public static byte[] encode(byte[] data)
                     throws java.io.IOException
Throws:
java.io.IOException

encode

public static void encode(java.io.OutputStream os,
                          byte[] data,
                          int length)
                   throws java.io.IOException
Throws:
java.io.IOException

encodeWithCache

public static byte[] encodeWithCache(byte[] data,
                                     int length)
                              throws java.io.IOException
Throws:
java.io.IOException

encode

public static byte[] encode(byte[] data,
                            int length)
                     throws java.io.IOException
Method for compressing given input data using LZF encoding and block structure (compatible with lzf command line utility). Result consists of a sequence of chunks.

Throws:
java.io.IOException