Package org.apache.datasketches.theta
Class BitPacking
java.lang.Object
org.apache.datasketches.theta.BitPacking
Used as part of Theta compression.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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
-
Constructor Details
-
BitPacking
public BitPacking()
-
-
Method Details
-
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
-