- java.lang.Object
-
- org.snmp4j.smi.AbstractVariable
-
- org.snmp4j.smi.OctetString
-
- org.snmp4j.smi.Opaque
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Comparable<Variable>,BERSerializable,AssignableFromByteArray,AssignableFromString,Variable
public class Opaque extends OctetString
TheOpaqueclass represents the SMI type Opaque which is used to transparently exchange BER encoded values.- Version:
- 1.7.6
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUID-
Fields inherited from class org.snmp4j.smi.AbstractVariable
SMISYNTAXES_PROPERTIES
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Clones this variable.voiddecodeBER(BERInputStream inputStream)Decodes aVariablefrom anBERInputStream.voidencodeBER(java.io.OutputStream outputStream)Encodes aVariableto anOutputStream.intgetSyntax()Gets the ASN.1 syntax identifier value of this SNMP variable.voidsetValue(OctetString value)java.lang.StringtoString()Returns a String representation of thisOctetString.-
Methods inherited from class org.snmp4j.smi.OctetString
append, append, append, append, clear, compareTo, equals, equalsValue, fromByteArray, fromCharArray, fromCharArray, fromHexString, fromHexString, fromHexStringPairs, fromIndex, fromString, fromString, fromString, fromSubIndex, get, getBERLength, getBERPayloadLength, getValue, hashCode, isPrintable, length, mask, set, setValue, setValue, split, startsWith, substring, toASCII, toByteArray, toByteArray, toHexString, toHexString, toInt, toLong, toString, toString, toSubIndex
-
Methods inherited from class org.snmp4j.smi.AbstractVariable
createFromBER, createFromSyntax, equal, getSyntaxFromString, getSyntaxString, getSyntaxString, isDynamic, isException
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSyntax
public int getSyntax()
Description copied from class:AbstractVariableGets the ASN.1 syntax identifier value of this SNMP variable.- Specified by:
getSyntaxin interfaceVariable- Overrides:
getSyntaxin classOctetString- Returns:
- an integer value less than 128 for regular SMI objects and a value greater or equal than 128 for exception values like noSuchObject, noSuchInstance, and endOfMibView.
-
encodeBER
public void encodeBER(java.io.OutputStream outputStream) throws java.io.IOExceptionDescription copied from class:AbstractVariableEncodes aVariableto anOutputStream.- Specified by:
encodeBERin interfaceBERSerializable- Overrides:
encodeBERin classOctetString- Parameters:
outputStream- anOutputStream.- Throws:
java.io.IOException- if an error occurs while writing to the stream.
-
decodeBER
public void decodeBER(BERInputStream inputStream) throws java.io.IOException
Description copied from class:AbstractVariableDecodes aVariablefrom anBERInputStream.- Specified by:
decodeBERin interfaceBERSerializable- Overrides:
decodeBERin classOctetString- Parameters:
inputStream- anBERInputStreamcontaining a BER encoded byte stream.- Throws:
java.io.IOException- if the stream could not be decoded by using BER rules.
-
setValue
public void setValue(OctetString value)
-
toString
public java.lang.String toString()
Description copied from class:OctetStringReturns a String representation of thisOctetString. If theOctetStringcontains non-printable characters, a hex-string representation is returned unlessSNMP4JSettings.getDefaultNonPrintableEscapeCharacter()returns a non-nullcharacter that is then used to replace all non-printable characters in the output.- Specified by:
toStringin interfaceVariable- Overrides:
toStringin classOctetString- Returns:
- a String representation of this
OctetString.
-
clone
public java.lang.Object clone()
Description copied from interface:VariableClones this variable. Cloning can be used by the SNMP4J API to better support concurrency by creating a clone for internal processing. The content of this object is independent to the content of the clone. Thus, changes to the clone will have no effect to this object.- Specified by:
clonein interfaceVariable- Overrides:
clonein classOctetString- Returns:
- a new instance of this
Variablewith the same value.
-
-