Class BERNodeError
java.lang.Object
com.snmp4j.smi.ber.BERNode
com.snmp4j.smi.ber.BERNodeError
A BER node representing a parse error: a deviation from the expected SNMP message structure.
- Since:
- 2.0.0
- Author:
- Frank Fock
-
Constructor Summary
ConstructorsConstructorDescriptionBERNodeError(int position, String errorMessage, byte[] offendingBytes, List<Integer> expectedTags) Creates a BER node representing a parse error. -
Method Summary
Modifier and TypeMethodDescriptionGets the BER tag values expected at this position.Gets the human-readable error message.byte[]Gets the raw bytes at the error position.toString()Returns a multi-line string representation of this BER node.Methods inherited from class BERNode
addChild, getChildren, getData, getDescription, getExpectedTags, getFormattedValue, getOid, getPos, getSequenceLength, getTag, getTagHex, getTagName, getTotalLength, isDecrypted, setDecrypted, setDescription, setExpectedTags, setFormattedValue, setOid, setSequenceLength
-
Constructor Details
-
BERNodeError
public BERNodeError(int position, String errorMessage, byte[] offendingBytes, List<Integer> expectedTags) Creates a BER node representing a parse error.- Parameters:
position- byte offset in the raw message where the error was detectederrorMessage- human-readable description of the erroroffendingBytes- raw bytes at the error position (may be empty or null)expectedTags- BER tag values that were expected at this position (decimal)
-
-
Method Details
-
getErrorMessage
-
getOffendingBytes
public byte[] getOffendingBytes()Gets the raw bytes at the error position.- Returns:
- the raw bytes at the error position.
-
getErrorExpectedTags
-
toString
-