org.mapdb
Class CompressLZF

java.lang.Object
  extended by org.mapdb.CompressLZF

public final class CompressLZF
extends Object

This class implements the LZF lossless data compression algorithm. LZF is a Lempel-Ziv variant with byte-aligned output, and optimized for speed.

Safety/Use Notes:

The LZF compressed format knows literal runs and back-references:

The first byte of the compressed stream is the control byte. For literal runs, the highest three bits of the control byte are not set, the the lower bits are the literal run length, and the next bytes are data to copy directly into the output. For back-references, the highest three bits of the control byte are the back-reference length. If all three bits are set, then the back-reference length is stored in the next byte. The lower bits of the control byte combined with the next byte form the offset for the back-reference.


Constructor Summary
CompressLZF()
           
 
Method Summary
 int compress(byte[] in, int inLen, byte[] out, int outPos)
           
 void expand(ByteBuffer in, int inPos, byte[] out, int outPos, int outLen)
           
 void expand(DataInput in, byte[] out, int outPos, int outLen)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompressLZF

public CompressLZF()
Method Detail

compress

public int compress(byte[] in,
                    int inLen,
                    byte[] out,
                    int outPos)

expand

public void expand(DataInput in,
                   byte[] out,
                   int outPos,
                   int outLen)
            throws IOException
Throws:
IOException

expand

public void expand(ByteBuffer in,
                   int inPos,
                   byte[] out,
                   int outPos,
                   int outLen)


Copyright © 2014. All Rights Reserved.