-
- All Known Implementing Classes:
DefaultTcpTransportMapping.SnmpMesssageLengthDecoder
public interface MessageLengthDecoder
TheMessageLengthDecoder
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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 ofgetMinHeaderLength()
.- Returns:
- the total message length in bytes and the actual header length in bytes.
- Throws:
java.io.IOException
- if the header cannot be decoded.
-
-