|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opends.server.protocols.asn1.ASN1Element
org.opends.server.protocols.asn1.ASN1OctetString
@PublicAPI(stability=UNCOMMITTED,
mayInstantiate=true,
mayExtend=false,
mayInvoke=true)
public final class ASN1OctetString
This class defines the data structures and methods to use when interacting
with ASN.1 octet string elements.
Note that this class also implements the ByteString interface,
but in most cases whenever it is necessary to create an instance of a
ByteString object, the caller should use one of the
ByteStringFactory.create methods rather than creating an
ASN1OctetString object directly. In general, direct references
to ASN.1 elements should be limited to cases in which ASN.1 is actually
involved.
| Constructor Summary | |
|---|---|
ASN1OctetString()
Creates a new ASN.1 octet string element with the default type and no value. |
|
ASN1OctetString(byte type)
Creates a new ASN.1 octet string element with the specified type and no value. |
|
ASN1OctetString(byte[] value)
Creates a new ASN.1 octet string element with the default type and the provided value. |
|
ASN1OctetString(byte type,
byte[] value)
Creates a new ASN.1 octet string element with the specified type and the provided value. |
|
ASN1OctetString(byte type,
java.lang.String stringValue)
Creates a new ASN.1 octet string element with the specified type and the provided value. |
|
ASN1OctetString(Message messageValue)
Creates a new ASN.1 octet string element with the default type and the provided value. |
|
ASN1OctetString(java.lang.String stringValue)
Creates a new ASN.1 octet string element with the default type and the provided value. |
|
| Method Summary | |
|---|---|
static ASN1OctetString |
decodeAsOctetString(ASN1Element element)
Decodes the provided ASN.1 element as an octet string element. |
static ASN1OctetString |
decodeAsOctetString(byte[] encodedElement)
Decodes the provided byte array as an ASN.1 octet string element. |
ASN1OctetString |
duplicate()
Creates a duplicate of this ASN.1 octet string. |
void |
setValue(byte[] value)
Specifies the value for this ASN.1 octet string element. |
void |
setValue(java.lang.String stringValue)
Specifies the string value for this ASN.1 octet string element. |
java.lang.String |
stringValue()
Retrieves the string representation of the value for this ASN.1 octet string element. |
void |
stringValue(java.lang.StringBuilder buffer)
Appends a string representation of the value for this ASN.1 octet string element to the provided buffer. |
ASN1OctetString |
toASN1OctetString()
Retrieves this byte string as an ASN.1 octet string. |
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this ASN.1 octet string element to the provided buffer. |
void |
toString(java.lang.StringBuilder buffer,
int indent)
Appends a string representation of this protocol element to the provided buffer. |
| Methods inherited from class org.opends.server.protocols.asn1.ASN1Element |
|---|
decode, decode, decodeAsBoolean, decodeAsEnumerated, decodeAsInteger, decodeAsLong, decodeAsNull, decodeAsOctetString, decodeAsSequence, decodeAsSet, decodeElements, encode, encodeLength, encodeLongValue, encodeValue, encodeValue, encodeValue, equals, equalsElement, equalsIgnoreType, equalsIgnoreType, getProtocolElementName, getType, hashCode, isApplicationSpecific, isConstructed, isContextSpecific, isPrimitive, isPrivate, isUniversal, setType, setValueInternal, toString, value |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.opends.server.types.ByteString |
|---|
toString, value |
| Constructor Detail |
|---|
public ASN1OctetString()
public ASN1OctetString(byte type)
type - The BER type for this ASN.1 octet string element.public ASN1OctetString(byte[] value)
value - The value for this ASN.1 octet string element.public ASN1OctetString(Message messageValue)
messageValue - The value for this ASN.1 octet string element as a
string.public ASN1OctetString(java.lang.String stringValue)
stringValue - The value for this ASN.1 octet string element as a
string.
public ASN1OctetString(byte type,
byte[] value)
type - The BER type for this ASN.1 octet string element.value - The value for this ASN.1 octet string element.
public ASN1OctetString(byte type,
java.lang.String stringValue)
type - The BER type for this ASN.1 octet string element.stringValue - The value for this ASN.1 octet string element as a
string.| Method Detail |
|---|
public java.lang.String stringValue()
stringValue in interface ByteStringpublic void stringValue(java.lang.StringBuilder buffer)
buffer - The buffer to which the string representation should be
appended.public void setValue(java.lang.String stringValue)
setValue in interface ByteStringstringValue - The string value for this ASN.1 octet string element.public void setValue(byte[] value)
setValue in interface ByteStringsetValue in class ASN1Elementvalue - The encoded value for this ASN.1 octet string element.
public static ASN1OctetString decodeAsOctetString(ASN1Element element)
throws ASN1Exception
element - The ASN.1 element to decode as an octet string element.
ASN1Exception - If the provided ASN.1 element cannot be decoded as
an octet string element.
public static ASN1OctetString decodeAsOctetString(byte[] encodedElement)
throws ASN1Exception
encodedElement - The byte array to decode as an ASN.1 octet string
element.
ASN1Exception - If the provided byte array cannot be decoded as an
ASN.1 octet string element.public ASN1OctetString duplicate()
duplicate in interface ByteStringpublic void toString(java.lang.StringBuilder buffer)
toString in interface ProtocolElementtoString in interface ByteStringtoString in class ASN1Elementbuffer - The buffer to which the information should be appended.
public void toString(java.lang.StringBuilder buffer,
int indent)
toString in interface ProtocolElementtoString in class ASN1Elementbuffer - The buffer into which the string representation should be
written.indent - The number of spaces that should be used to indent the
resulting string representation.public ASN1OctetString toASN1OctetString()
toASN1OctetString in interface ByteString
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||