Class LongZigzagEncoder


  • public class LongZigzagEncoder
    extends Encoder
    Encoder for long value using Zigzag . For more information, see https://gist.github.com/mfuerstenau/ba870a29e16536fdbaba
    • Constructor Detail

      • LongZigzagEncoder

        public LongZigzagEncoder()
    • Method Detail

      • print

        public static java.lang.String print​(byte[] bytes)
      • encode

        public void encode​(long value,
                           java.io.ByteArrayOutputStream out)
        Overrides:
        encode in class Encoder
      • 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
      • 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