public class PDUByteBuffer
extends java.lang.Object
Constructor and Description |
---|
PDUByteBuffer()
Default constructor.
|
PDUByteBuffer(CapacityPolicy capacityPolicy)
Construct with specified capacity policy.
|
PDUByteBuffer(int commandId,
int commandStatus,
int sequenceNumber)
Construct with specified command_id, command_status, and sequence_number.
|
PDUByteBuffer(int commandId,
int commandStatus,
int sequenceNumber,
CapacityPolicy capacityPolicy)
Construct with specified command_id, command_status, sequence_number and
capacity policy.
|
Modifier and Type | Method and Description |
---|---|
int |
append(byte b)
Append single byte.
|
int |
append(byte[] bytes)
Append all bytes.
|
int |
append(byte[] b,
int offset,
int length)
Append bytes to specified offset and length.
|
int |
append(int intValue)
Append int value (contains 4 octet).
|
int |
append(OptionalParameter optionalParameter)
Append an optional parameter.
|
int |
append(java.lang.String stringValue)
Append C-Octet String / null terminated String value.
|
int |
append(java.lang.String stringValue,
boolean nullTerminated)
Append String value.
|
int |
appendAll(OptionalParameter[] optionalParameters)
Append all optional parameters.
|
byte[] |
toBytes()
Get the composed bytes of PDU.
|
public PDUByteBuffer(int commandId, int commandStatus, int sequenceNumber)
commandId
- is the command_id.commandStatus
- is the command_status.sequenceNumber
- is the sequence_number.public PDUByteBuffer(int commandId, int commandStatus, int sequenceNumber, CapacityPolicy capacityPolicy)
commandId
- is the command_id.commandStatus
- is the command_status.sequenceNumber
- is the sequence_number.capacityPolicy
- is the capacity policy.public PDUByteBuffer()
public PDUByteBuffer(CapacityPolicy capacityPolicy)
capacityPolicy
- is the capacity policy.public int append(byte[] b, int offset, int length)
b
- is the bytes to append.offset
- is the offset where the bytes will be placed.length
- the length that will specified which part of the bytes will
be append.public int append(byte[] bytes)
bytes
- is the bytes to append.public int append(byte b)
b
- is the byte to append.public int append(int intValue)
intValue
- is the value to append.public int append(java.lang.String stringValue, boolean nullTerminated)
stringValue
- nullTerminated
- true means C-Octet String.
The default value is true.public int append(java.lang.String stringValue)
stringValue
- is the value to append.public int append(OptionalParameter optionalParameter)
optionalParameter
- is the optional parameter.public int appendAll(OptionalParameter[] optionalParameters)
optionalParameters
- is the optional parameters.public byte[] toBytes()