Package org.apache.kerby.xdr.type
Class XdrInteger
- All Implemented Interfaces:
XdrType
Xdr Integer type from RFC 4506
An XDR signed integer is a 32-bit datum
that encodes an integer in the range [-2147483648,2147483647].
The integer is represented in two's complement notation.
The most and least significant bytes are0 and 3, respectively.
Integers are declared as follows:
int identifier;
(MSB) (LSB)
+-------+-------+-------+-------+
|byte 0 |byte 1 |byte 2 |byte 3 |
+-------+-------+-------+-------+
|------------32 bits------------|
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.kerby.xdr.type.XdrSimple
decode, decodeBody, encodeBody, encodeBody, getBytes, isSimple, setBytesMethods inherited from class org.apache.kerby.xdr.type.AbstractXdrType
decode, encode, encode, encodingLength, getDataType, getValue, setValue
-
Constructor Details
-
XdrInteger
public XdrInteger() -
XdrInteger
-
-
Method Details
-
encodingBodyLength
protected int encodingBodyLength()The length of a signed integer is 4.- Overrides:
encodingBodyLengthin classXdrSimple<Integer>- Returns:
- Length of a signed integer type.
-
toBytes
protected void toBytes()Encode Integer type to bytes. Cannot only use toByteArray() because of fixed 4 bytes length. -
toValue
protected void toValue()Decode bytes to Integer value.
-