Package org.apache.datasketches.theta
Class BitPacking
- java.lang.Object
-
- org.apache.datasketches.theta.BitPacking
-
public class BitPacking extends Object
Used as part of Theta compression.
-
-
Constructor Summary
Constructors Constructor Description BitPacking()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
packBits(long value, int bits, byte[] buffer, int bufOffset, int bitOffset)
The bit packing operationstatic void
unpackBits(long[] value, int index, int bits, byte[] buffer, int bufOffset, int bitOffset)
The unpacking operation
-
-
-
Method Detail
-
packBits
public static void packBits(long value, int bits, byte[] buffer, int bufOffset, int bitOffset)
The bit packing operation- Parameters:
value
- the value to packbits
- number of bits to packbuffer
- the output byte array bufferbufOffset
- the byte offset in the bufferbitOffset
- the bit offset
-
unpackBits
public static void unpackBits(long[] value, int index, int bits, byte[] buffer, int bufOffset, int bitOffset)
The unpacking operation- Parameters:
value
- the output arrayindex
- index of the value arraybits
- the number of bits to unpackbuffer
- the input packed bufferbufOffset
- the buffer offsetbitOffset
- the bit offset
-
-