Class Simple64


  • public class Simple64
    extends java.lang.Object
    Very simple variable byte encoding that always uses 64bit units. The idea is that the next few values are smashed into 64 bits using a few bits to indicate how they are fitted in and the rest of the bits to fit each value into equal-sized chunks. In this encoding, 4 bits are used to indicate how the remaining 60 bits are divided. The possible ways are shown in the following table:
    CodeArrangement
    14 1 X 60BITS
    13 2 X 30BITS
    12 3 X 20BITS
    11 4 X 15BITS
    10 5 X 12BITS
    9 6 X 10BITS
    8 7 X 8BITS
    7 8 X 7BITS
    6 10 X 6BITS
    5 12 X 5BITS
    4 15 X 4BITS
    3 20 X 3BITS
    2 30 X 2BITS
    1 60 X 1BITS
    • Constructor Detail

      • Simple64

        public Simple64()
    • Method Detail

      • reset

        private void reset()
      • add

        public int add​(long v,
                       long[] out)
      • compressSingle

        private static int compressSingle​(long[] uncompressed,
                                          int inOffset,
                                          int inSize,
                                          java.nio.LongBuffer compressedBuffer)
      • decompressSingle

        private static int decompressSingle​(long s9,
                                            long[] decompressed,
                                            int outOffset)
      • compress

        public static void compress​(java.nio.LongBuffer compressedBuffer,
                                    long[] unCompressedData,
                                    int offset,
                                    int size)
      • decompress

        public static int decompress​(java.nio.LongBuffer compressedBuffer,
                                     long[] unCompressedData)