Module org.snmp4j
Package org.snmp4j.transport
Class DefaultTcpTransportMapping.SnmpMesssageLengthDecoder
java.lang.Object
org.snmp4j.transport.DefaultTcpTransportMapping.SnmpMesssageLengthDecoder
- All Implemented Interfaces:
MessageLengthDecoder
- Enclosing class:
DefaultTcpTransportMapping
public static class DefaultTcpTransportMapping.SnmpMesssageLengthDecoder
extends Object
implements MessageLengthDecoder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the total message length to read (including header) and the actual header length.int
Returns the minimum length of the header to be decoded.
-
Constructor Details
-
SnmpMesssageLengthDecoder
public SnmpMesssageLengthDecoder()
-
-
Method Details
-
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 interfaceMessageLengthDecoder
- Returns:
- the minimum length in bytes.
-
getMessageLength
Description copied from interface:MessageLengthDecoder
Returns the total message length to read (including header) and the actual header length.- Specified by:
getMessageLength
in interfaceMessageLengthDecoder
- Parameters:
buf
- a ByteBuffer with a minimum ofMessageLengthDecoder.getMinHeaderLength()
.- Returns:
- the total message length in bytes and the actual header length in bytes.
- Throws:
IOException
- if the header cannot be decoded.
-