A utility class to help decode PDUs.
This class extends a ByteArrayInputStream and adds methods to help
read from PDUs.
Constructor and description |
---|
InputPDU
(byte[] pdu) Constructs a PDU from byte buffer. |
Type Params | Return Type | Name and description |
---|---|---|
|
int |
length() Gets the length of PDU. |
|
int |
read(byte[] buf) Reads a byte buffer from the PDU. |
|
int |
read16() Reads a signed 16-bit word from the PDU. |
|
int |
read16u() Reads an unsigned 16-bit word from the PDU. |
|
int |
read24() Reads a signed 24-bit word from the PDU. |
|
int |
read24u() Reads an unsigned 24-bit word from the PDU. |
|
int |
read32() Reads a signed 32-bit word from the PDU. |
|
long |
read32u() Reads an unsigned 32-bit word from the PDU. |
|
long |
read48() Reads a signed 48-bit word from the PDU. |
|
long |
read48u() Reads an unsigned 48-bit word from the PDU. |
|
int |
read8() Reads a signed byte from the PDU. |
|
int |
read8u() Reads an unsigned byte from the PDU. |
Constructs a PDU from byte buffer.
pdu
- byte bufferGets the length of PDU.
Reads a byte buffer from the PDU.
buf
- buffer to fillReads a signed 16-bit word from the PDU.
Reads an unsigned 16-bit word from the PDU.
Reads a signed 24-bit word from the PDU.
Reads an unsigned 24-bit word from the PDU.
Reads a signed 32-bit word from the PDU.
Reads an unsigned 32-bit word from the PDU.
Reads a signed 48-bit word from the PDU.
Reads an unsigned 48-bit word from the PDU.
Reads a signed byte from the PDU.
Reads an unsigned byte from the PDU.
Copyright 2013-21, Acoustic Research Laboratory, National University of Singapore, and Subnero Pte Ltd