Package org.ka2ddo.ax25
Class XIDParameter
java.lang.Object
org.ka2ddo.ax25.XIDParameter
This class encapsulates one XID parameter. The caller is responsible for putting
the XIDParameter object into an appropriately typed XIDGroup object.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte[]
byte
byte[]
-
Constructor Summary
ConstructorDescriptionXIDParameter
(byte paramIdentifier) Create an XIDParameter with an empty value (presence implies the value).XIDParameter
(byte paramIdentifier, byte val) Create an XIDParameter with a 1-byte value.XIDParameter
(byte paramIdentifier, int val, boolean is3Byte) Create an XIDParameter with a 3- or 4-byte value.XIDParameter
(byte paramIdentifier, short val) Create an XIDParameter with a 2-byte value. -
Method Summary
Modifier and TypeMethodDescriptionbyte
Get the length of the parameter's value.static XIDParameter
Read an XIDParameter from a byte stream.toString()
Returns a string representation of the XIDParameter object.void
write
(DataOutput dos) Write the XIDParameter to a byte stream.
-
Field Details
-
EMPTY_VALUE
public static final byte[] EMPTY_VALUE -
paramIdentifier
public byte paramIdentifier -
paramValue
public byte[] paramValue
-
-
Constructor Details
-
XIDParameter
public XIDParameter(byte paramIdentifier) Create an XIDParameter with an empty value (presence implies the value).- Parameters:
paramIdentifier
- identifier code
-
XIDParameter
public XIDParameter(byte paramIdentifier, byte val) Create an XIDParameter with a 1-byte value.- Parameters:
paramIdentifier
- identifier codeval
- value of parameter
-
XIDParameter
public XIDParameter(byte paramIdentifier, short val) Create an XIDParameter with a 2-byte value.- Parameters:
paramIdentifier
- identifier codeval
- value of parameter
-
XIDParameter
public XIDParameter(byte paramIdentifier, int val, boolean is3Byte) Create an XIDParameter with a 3- or 4-byte value.- Parameters:
paramIdentifier
- identifier codeval
- value of parameteris3Byte
- boolean true if value only requires 24 bits to encode
-
-
Method Details
-
getParamLength
public byte getParamLength()Get the length of the parameter's value.- Returns:
- length of value in octets (bytes)
-
write
Write the XIDParameter to a byte stream.- Parameters:
dos
- DataOutput to write the value to- Throws:
IOException
- if write fails for any reason
-
read
Read an XIDParameter from a byte stream.- Parameters:
dis
- DataInput to read the parameter from- Returns:
- decoded XIDParameter element
- Throws:
IOException
- if read fails for any reason
-
toString
Returns a string representation of the XIDParameter object.
-