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 and Description
`BitPacking()`

### Method Summary

All Methods Static Methods Concrete Methods
`static void` `packBits(long value, int bits, byte[] buffer, int bufOffset, int bitOffset)` The bit packing operation
`static void` `unpackBits(long[] value, int index, int bits, byte[] buffer, int bufOffset, int bitOffset)` The unpacking operation

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### BitPacking

    public BitPacking()

### 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 pack
  `bits` - number of bits to pack
  `buffer` - the output byte array buffer
  `bufOffset` - the byte offset in the buffer
  `bitOffset` - 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 array
  `index` - index of the value array
  `bits` - the number of bits to unpack
  `buffer` - the input packed buffer
  `bufOffset` - the buffer offset
  `bitOffset` - the bit offset