Package org.snmp4j.transport
Class MessageLength
java.lang.Object
org.snmp4j.transport.MessageLength
- All Implemented Interfaces:
Serializable
The
MessageLength object contains information about the
length of a message and the length of its header.- Since:
- 1.7
- Version:
- 1.7
- Author:
- Frank Fock
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMessageLength(int headerLength, int payloadLength) Constructs a MessageLength object. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the length of the header.intReturns the total message length (header+payload).intReturns the length of the payload.toString()
-
Constructor Details
-
MessageLength
public MessageLength(int headerLength, int payloadLength) Constructs a MessageLength object.- Parameters:
headerLength- the length in bytes of the message header.payloadLength- the length of the payload.
-
-
Method Details
-
getPayloadLength
public int getPayloadLength()Returns the length of the payload.- Returns:
- the length in bytes.
-
getHeaderLength
public int getHeaderLength()Returns the length of the header.- Returns:
- the length in bytes.
-
getMessageLength
public int getMessageLength()Returns the total message length (header+payload).- Returns:
- the sum of
getHeaderLength()andgetPayloadLength().
-
toString
-