org.snmp4j.transport
Interface MessageLengthDecoder

All Known Implementing Classes:
DefaultTcpTransportMapping.SnmpMesssageLengthDecoder

public interface MessageLengthDecoder

The MessageLengthDecoder needs to be implemented for connection oriented transport mappings, because those transport mappings have no message boundaries. To determine the message length, the message header is decoded in a protocol specific way.

Since:
1.7
Version:
1.7
Author:
Frank Fock

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.
 

Method Detail

getMinHeaderLength

int getMinHeaderLength()
Returns the minimum length of the header to be decoded. Typically this is a constant value.

Returns:
the minimum length in bytes.

getMessageLength

MessageLength getMessageLength(java.nio.ByteBuffer buf)
                               throws java.io.IOException
Returns the total message length to read (including header) and the actual header length.

Parameters:
buf - a ByteBuffer with a minimum of 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.