me.lemire.integercompression
Class XorBinaryPacking

java.lang.Object
  extended by me.lemire.integercompression.XorBinaryPacking
All Implemented Interfaces:
IntegerCODEC, IntegratedIntegerCODEC

public final class XorBinaryPacking
extends Object
implements IntegratedIntegerCODEC

XOR + BinaryPacking.

Author:
MURAOKA Taro http://github.com/koron

Field Summary
static int BLOCK_LENGTH
           
static boolean DEBUG_DISABLE_BITPACKING
          A flag for debugging.
 
Constructor Summary
XorBinaryPacking()
           
 
Method Summary
 void compress(int[] inBuf, IntWrapper inPos, int inLen, int[] outBuf, IntWrapper outPos)
          Compress data from an array to another array.
 String toString()
           
 void uncompress(int[] inBuf, IntWrapper inPos, int inLen, int[] outBuf, IntWrapper outPos)
          Uncompress data from an array to another array.
static int xorMaxBits(int[] buf, int offset, int length, int context)
           
static int xorPack(int[] inBuf, int inOff, int[] outBuf, int outOff, int validBits, int context, int[] work)
           
static int xorUnpack(int[] inBuf, int inOff, int[] outBuf, int outOff, int validBits, int context, int[] work)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG_DISABLE_BITPACKING

public static final boolean DEBUG_DISABLE_BITPACKING
A flag for debugging.

See Also:
Constant Field Values

BLOCK_LENGTH

public static final int BLOCK_LENGTH
See Also:
Constant Field Values
Constructor Detail

XorBinaryPacking

public XorBinaryPacking()
Method Detail

compress

public void compress(int[] inBuf,
                     IntWrapper inPos,
                     int inLen,
                     int[] outBuf,
                     IntWrapper outPos)
Description copied from interface: IntegerCODEC
Compress data from an array to another array. Both inpos and outpos are modified to represent how much data was read and written to if 12 ints (inlength = 12) are compressed to 3 ints, then inpos will be incremented by 12 while outpos will be incremented by 3 we use IntWrapper to pass the values by reference.

Specified by:
compress in interface IntegerCODEC
Parameters:
inBuf - input array
inPos - location in the input array
inLen - how many integers to compress
outBuf - output array
outPos - where to write in the output array

uncompress

public void uncompress(int[] inBuf,
                       IntWrapper inPos,
                       int inLen,
                       int[] outBuf,
                       IntWrapper outPos)
Description copied from interface: IntegerCODEC
Uncompress data from an array to another array. Both inpos and outpos parameters are modified to indicate new positions after read/write.

Specified by:
uncompress in interface IntegerCODEC
Parameters:
inBuf - array containing data in compressed form
inPos - where to start reading in the array
inLen - length of the compressed data (ignored by some schemes)
outBuf - array where to write the compressed output
outPos - where to write the compressed output in out

toString

public String toString()
Overrides:
toString in class Object

xorMaxBits

public static int xorMaxBits(int[] buf,
                             int offset,
                             int length,
                             int context)

xorPack

public static int xorPack(int[] inBuf,
                          int inOff,
                          int[] outBuf,
                          int outOff,
                          int validBits,
                          int context,
                          int[] work)

xorUnpack

public static int xorUnpack(int[] inBuf,
                            int inOff,
                            int[] outBuf,
                            int outOff,
                            int validBits,
                            int context,
                            int[] work)


Copyright © 2013. All Rights Reserved.