- java.lang.Object
-
- org.snmp4j.smi.AbstractVariable
-
- org.snmp4j.smi.OctetString
-
- org.snmp4j.smi.BitString
-
- All Implemented Interfaces:
java.lang.Cloneable
,java.lang.Comparable<Variable>
,BERSerializable
,AssignableFromByteArray
,AssignableFromString
,Variable
public class BitString extends OctetString
TheBitString
class represents the obsolete SMI type BIT STRING which has been defined in RFC 1442 (an SNMPv2 draft) but which has been obsoleteted by RFC 1902 and RFC 2578. This type is provided for compatibility only and should not be used for new applications.- Since:
- 1.7.4
- Version:
- 1.7.4
- Author:
- Frank Fock
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.snmp4j.smi.AbstractVariable
SMISYNTAXES_PROPERTIES
-
-
Constructor Summary
Constructors Constructor Description BitString()
Deprecated.The BIT STRING type has been temporarily defined in RFC 1442 and obsoleted by RFC 2578. Use OctetString (i.e. BITS syntax) instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Clones this variable.void
decodeBER(BERInputStream inputStream)
Decodes aVariable
from anBERInputStream
.void
encodeBER(java.io.OutputStream outputStream)
Encodes aVariable
to anOutputStream
.int
getSyntax()
Gets the ASN.1 syntax identifier value of this SNMP variable.-
Methods inherited from class org.snmp4j.smi.AbstractVariable
createFromBER, createFromSyntax, equal, getSyntaxFromString, getSyntaxString, getSyntaxString, isDynamic, isException
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
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, toString, toSubIndex
-
-
-
-
Method Detail
-
getSyntax
public int getSyntax()
Description copied from class:AbstractVariable
Gets the ASN.1 syntax identifier value of this SNMP variable.- Specified by:
getSyntax
in interfaceVariable
- Overrides:
getSyntax
in 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.IOException
Description copied from class:AbstractVariable
Encodes aVariable
to anOutputStream
.- Specified by:
encodeBER
in interfaceBERSerializable
- Overrides:
encodeBER
in 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:AbstractVariable
Decodes aVariable
from anBERInputStream
.- Specified by:
decodeBER
in interfaceBERSerializable
- Overrides:
decodeBER
in classOctetString
- Parameters:
inputStream
- anBERInputStream
containing a BER encoded byte stream.- Throws:
java.io.IOException
- if the stream could not be decoded by using BER rules.
-
clone
public java.lang.Object clone()
Description copied from interface:Variable
Clones 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:
clone
in interfaceVariable
- Overrides:
clone
in classOctetString
- Returns:
- a new instance of this
Variable
with the same value.
-
-