org.snmp4j.transport
Class MessageLength

java.lang.Object
  extended by org.snmp4j.transport.MessageLength
All Implemented Interfaces:
java.io.Serializable

public class MessageLength
extends java.lang.Object
implements java.io.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:
Serialized Form

Constructor Summary
MessageLength(int headerLength, int payloadLength)
          Constructs a MessageLength object.
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 Detail

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() and getPayloadLength().

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Copyright 2005-2010 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.