| | | | SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
|
com.newstep.solid.netio.slip.codec
public class SignedByteCodec
Encodes and decodes SLIP message headers containing the payload length. On
encoding the codec converts the signed integer value into a signed byte
first ensuring that the length value will fit in a signed byte.
(ie. 0--> 2^7 - 1).
In order to decode SLIP messages, the codec simply needs to read the byte
value into an integer.
Implements:
SlipMessageHeaderCodec
Links:
Implementation Implementation Link
Encodes and decodes SLIP message headers containing the payload length. On
encoding the codec converts the signed integer value into a signed byte
first ensuring that the length value will fit in a signed byte.
(ie. 0--> 2^7 - 1).
In order to decode SLIP messages, the codec simply needs to read the byte
value into an integer.
| Method Summary |
public int |
|
public void |
encode(ByteBuffer buffer, Integer length) |
public int decode (ByteBuffer buffer)
Decodes the length value from the specified buffer
Parameters:
buffer The ByteBuffer from which to decode the payload length
value
public void encode (ByteBuffer buffer, Integer length)
Encodes the payload length into the specified buffer by converting the
signed integer value into a signed byte. This function first ensures the
integer value will fit in a signed byte (0--> 2^7-1)
Parameters:
buffer The ByteBuffer into which the length header should be
encoded
length The signed integer value representing the size of the SLIP
message's associated payload (in bytes). Must fit into a signed byte
(0 --> 2^7-1)
| | | | SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
|