Class XdrUnsignedInteger

All Implemented Interfaces:
XdrType

public class XdrUnsignedInteger extends XdrSimple<Long>
Xdr Unsigned Integer type from RFC 4506 An XDR unsigned integer is a 32-bit datum that encodes a non-negative integer in the range [0,4294967295]. It is represented by an unsigned binary number whose most and least significant bytes are 0 and 3, respectively. An unsigned integer is declared as follows: unsigned int identifier; (MSB) (LSB) +-------+-------+-------+-------+ |byte 0 |byte 1 |byte 2 |byte 3 | +-------+-------+-------+-------+ |------------32 bits------------|
  • Constructor Details

    • XdrUnsignedInteger

      public XdrUnsignedInteger()
    • XdrUnsignedInteger

      public XdrUnsignedInteger(String value)
    • XdrUnsignedInteger

      public XdrUnsignedInteger(Long value)
  • Method Details

    • encodingBodyLength

      protected int encodingBodyLength()
      The length of an unsigned integer is 4.
      Overrides:
      encodingBodyLength in class XdrSimple<Long>
      Returns:
      Length of a unsigned integer type.
    • toBytes

      protected void toBytes() throws IOException
      Encode Unsigned Integer type to bytes.
      Specified by:
      toBytes in class XdrSimple<Long>
      Throws:
      IOException - e
    • toValue

      protected void toValue()
      Decode bytes to Unsigned Integer value.
      Specified by:
      toValue in class XdrSimple<Long>