Class VarSignedLongCodec

  • All Implemented Interfaces:
    Codec<java.lang.Long>

    public class VarSignedLongCodec
    extends VarLongCodec
    Implementation of a variable length Codec for a signed Long
    • Constructor Detail

      • VarSignedLongCodec

        public VarSignedLongCodec()
    • Method Detail

      • encode

        public void encode​(java.lang.Long value,
                           java.io.DataOutput dataOut)
                    throws java.io.IOException
        Description copied from interface: Codec
        Write the payload of the object to the DataOutput stream.
        Specified by:
        encode in interface Codec<java.lang.Long>
        Overrides:
        encode in class VarLongCodec
        Throws:
        java.io.IOException
      • decode

        public java.lang.Long decode​(java.io.DataInput dataIn)
                              throws java.io.IOException
        Description copied from interface: Codec
        Read the payload of the object from the DataInput stream.
        Specified by:
        decode in interface Codec<java.lang.Long>
        Overrides:
        decode in class VarLongCodec
        Returns:
        unmarshalled object
        Throws:
        java.io.IOException
      • decodeZigZag

        private static long decodeZigZag​(long n)
      • encodeZigZag

        private static long encodeZigZag​(long n)
      • estimatedSize

        public int estimatedSize​(java.lang.Long value)
        Specified by:
        estimatedSize in interface Codec<java.lang.Long>
        Overrides:
        estimatedSize in class VarLongCodec
        Returns:
        the estimated marshaled size of the object.