me.lemire.integercompression
Class IntegratedVariableByte

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

public class IntegratedVariableByte
extends Object
implements IntegratedIntegerCODEC, IntegratedByteIntegerCODEC

Implementation of variable-byte with differential coding. For best performance, use it using the IntegratedByteIntegerCODEC interface. You should only use this scheme on sorted arrays. Use VariableByte if you have unsorted arrays.

Author:
Daniel Lemire

Constructor Summary
IntegratedVariableByte()
           
 
Method Summary
 void compress(int[] in, IntWrapper inpos, int inlength, byte[] out, IntWrapper outpos)
          Compress data from an array to another array.
 void compress(int[] in, IntWrapper inpos, int inlength, int[] out, IntWrapper outpos)
          Compress data from an array to another array.
 String toString()
           
 void uncompress(byte[] in, IntWrapper inpos, int inlength, int[] out, IntWrapper outpos)
          Uncompress data from an array to another array.
 void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out, IntWrapper outpos)
          Uncompress data from an array to another array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntegratedVariableByte

public IntegratedVariableByte()
Method Detail

compress

public void compress(int[] in,
                     IntWrapper inpos,
                     int inlength,
                     int[] out,
                     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:
in - input array
inpos - location in the input array
inlength - how many integers to compress
out - output array
outpos - where to write in the output array

compress

public void compress(int[] in,
                     IntWrapper inpos,
                     int inlength,
                     byte[] out,
                     IntWrapper outpos)
Description copied from interface: ByteIntegerCODEC
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 bytes, 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 ByteIntegerCODEC
Parameters:
in - input array
inpos - location in the input array
inlength - how many integers to compress
out - output array
outpos - where to write in the output array

uncompress

public void uncompress(int[] in,
                       IntWrapper inpos,
                       int inlength,
                       int[] out,
                       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:
in - array containing data in compressed form
inpos - where to start reading in the array
inlength - length of the compressed data (ignored by some schemes)
out - array where to write the compressed output
outpos - where to write the compressed output in out

uncompress

public void uncompress(byte[] in,
                       IntWrapper inpos,
                       int inlength,
                       int[] out,
                       IntWrapper outpos)
Description copied from interface: ByteIntegerCODEC
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 ByteIntegerCODEC
Parameters:
in - array containing data in compressed form
inpos - where to start reading in the array
inlength - length of the compressed data (ignored by some schemes)
out - 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


Copyright © 2013. All Rights Reserved.