Class FloatSprintzEncoder

    • Field Detail

      • values

        protected java.util.Vector<java.lang.Float> values
        we save all value in a list and calculate its bitwidth.
    • Constructor Detail

      • FloatSprintzEncoder

        public FloatSprintzEncoder()
    • Method Detail

      • getOneItemMaxSize

        public int getOneItemMaxSize()
        Description copied from class: Encoder
        When encoder accepts a new incoming data point, the maximal possible size in byte it takes to store in memory.
        Overrides:
        getOneItemMaxSize in class Encoder
        Returns:
        the maximal possible size of one data item encoded by this encoder
      • getMaxByteSize

        public long getMaxByteSize()
        Description copied from class: Encoder
        The maximal possible memory size occupied by current Encoder. This statistic value doesn't involve OutputStream.
        Overrides:
        getMaxByteSize in class Encoder
        Returns:
        the maximal size of possible memory occupied by current encoder
      • bitPack

        protected void bitPack()
                        throws java.io.IOException
        Specified by:
        bitPack in class SprintzEncoder
        Throws:
        java.io.IOException
      • delta

        protected int delta​(java.lang.Float value,
                            java.lang.Float preValue)
      • fire

        protected int fire​(java.lang.Float value,
                           java.lang.Float preValue)
      • flush

        public void flush​(java.io.ByteArrayOutputStream out)
                   throws java.io.IOException
        Description copied from class: Encoder
        Write all values buffered in memory cache to OutputStream.
        Specified by:
        flush in class Encoder
        Parameters:
        out - - ByteArrayOutputStream
        Throws:
        java.io.IOException - cannot flush to OutputStream
      • encode

        public void encode​(float value,
                           java.io.ByteArrayOutputStream out)
        Overrides:
        encode in class Encoder