Class VINT


  • public class VINT
    extends Object
    Variable size integer class EBML RFC
    • Constructor Detail

      • VINT

        public VINT​(long binary,
                    byte length,
                    long value)
        Constructor
        Parameters:
        binary - - binary value of this VINT, calculated from value if not specified
        length - - length of this VINT
        value - - value of this VINT
    • Method Detail

      • getLength

        public byte getLength()
        getter for length
        Returns:
        - length
      • getBinary

        public long getBinary()
        getter for binary
        Returns:
        - binary
      • getValue

        public long getValue()
        getter for value
        Returns:
        - value
      • encode

        public byte[] encode()
        method to encode VINT as sequence of bytes
        Returns:
        - encoded VINT
      • fromBinary

        public static VINT fromBinary​(long binary)
        method to construct VINT based on its binary representation
        Parameters:
        binary - - binary value of VINT
        Returns:
        VINT corresponding to this binary
      • fromValue

        public static VINT fromValue​(long value)
        method to construct VINT based on its value
        Parameters:
        value - - value of VINT
        Returns:
        VINT corresponding to this value