org.snmp4j.transport
Class DefaultTcpTransportMapping.SnmpMesssageLengthDecoder

java.lang.Object
  extended by org.snmp4j.transport.DefaultTcpTransportMapping.SnmpMesssageLengthDecoder
All Implemented Interfaces:
MessageLengthDecoder
Enclosing class:
DefaultTcpTransportMapping

public static class DefaultTcpTransportMapping.SnmpMesssageLengthDecoder
extends java.lang.Object
implements MessageLengthDecoder


Constructor Summary
DefaultTcpTransportMapping.SnmpMesssageLengthDecoder()
           
 
Method Summary
 MessageLength getMessageLength(java.nio.ByteBuffer buf)
          Returns the total message length to read (including header) and the actual header length.
 int getMinHeaderLength()
          Returns the minimum length of the header to be decoded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTcpTransportMapping.SnmpMesssageLengthDecoder

public DefaultTcpTransportMapping.SnmpMesssageLengthDecoder()
Method Detail

getMinHeaderLength

public int getMinHeaderLength()
Description copied from interface: MessageLengthDecoder
Returns the minimum length of the header to be decoded. Typically this is a constant value.

Specified by:
getMinHeaderLength in interface MessageLengthDecoder
Returns:
the minimum length in bytes.

getMessageLength

public MessageLength getMessageLength(java.nio.ByteBuffer buf)
                               throws java.io.IOException
Description copied from interface: MessageLengthDecoder
Returns the total message length to read (including header) and the actual header length.

Specified by:
getMessageLength in interface MessageLengthDecoder
Parameters:
buf - a ByteBuffer with a minimum of MessageLengthDecoder.getMinHeaderLength().
Returns:
the total message length in bytes and the actual header length in bytes.
Throws:
java.io.IOException - if the header cannot be decoded.

Copyright 2005-2010 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.