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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 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