public class MessageLength
extends java.lang.Object
implements java.io.Serializable
MessageLength
object contains information about the
length of a message and the length of its header.Modifier and Type | Field and Description |
---|---|
private int |
headerLength |
private int |
payloadLength |
private static long |
serialVersionUID |
Constructor and Description |
---|
MessageLength(int headerLength,
int payloadLength)
Constructs a MessageLength object.
|
Modifier and Type | Method and Description |
---|---|
int |
getHeaderLength()
Returns the length of the header.
|
int |
getMessageLength()
Returns the total message length (header+payload).
|
int |
getPayloadLength()
Returns the length of the payload.
|
java.lang.String |
toString() |
private static final long serialVersionUID
private int payloadLength
private int headerLength
public MessageLength(int headerLength, int payloadLength)
headerLength
- the length in bytes of the message header.payloadLength
- the length of the payload.public int getPayloadLength()
public int getHeaderLength()
public int getMessageLength()
getHeaderLength()
and getPayloadLength()
.public java.lang.String toString()
toString
in class java.lang.Object