me.lemire.integercompression
Class XorBinaryPacking
java.lang.Object
me.lemire.integercompression.XorBinaryPacking
- All Implemented Interfaces:
- IntegerCODEC, IntegratedIntegerCODEC
public final class XorBinaryPacking
- extends Object
- implements IntegratedIntegerCODEC
BinaryPacking over XOR differential.
IntegratedIntegerCODEC is =
new Composition(new XorBinaryPacking(), new VariableByte())
- Author:
- MURAOKA Taro http://github.com/koron
XorBinaryPacking
public XorBinaryPacking()
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 arrayinPos - location in the input arrayinLen - how many integers to compressoutBuf - output arrayoutPos - 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 forminPos - where to start reading in the arrayinLen - length of the compressed data (ignored by some
schemes)outBuf - array where to write the compressed outputoutPos - where to write the compressed output in out
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2014. All Rights Reserved.