Class Option


  • public class Option
    extends java.lang.Object
    Options are TLVs at the end of the blocks.
    • Constructor Summary

      Constructors 
      Constructor Description
      Option​(int code, byte[] value)
      Creates an option with given type and value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int code()
      Returns the code of option.
      int size()
      Returns the total size of this option in bytes.
      byte[] value()
      Returns the value of option.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Option

        public Option​(int code,
                      byte[] value)
        Creates an option with given type and value.
        Parameters:
        code - Code of option.
        value - Value of option.
    • Method Detail

      • code

        public int code()
        Returns the code of option.
        Returns:
        code of option.
      • value

        public byte[] value()
        Returns the value of option.
        Returns:
        value of option.
      • size

        public int size()
        Returns the total size of this option in bytes. The size includes the entire length including 2 byte code, 2 byte length and padding.
        Returns:
        Total option size in bytes.