org.opends.server.types
Interface ByteString

All Known Implementing Classes:
ASN1OctetString

@PublicAPI(stability=UNCOMMITTED,
           mayInstantiate=false,
           mayExtend=false,
           mayInvoke=true)
public interface ByteString

This interface defines data type that is backed by a byte array but may also have a string representation. The preferred way to create a ByteString object is to use one of the ByteStringFactory.create methods.


Method Summary
 ByteString duplicate()
          Creates a duplicate of this byte string whose contents can be altered without impacting this byte string.
 void setValue(byte[] value)
          Sets the value for this byte string.
 void setValue(java.lang.String value)
          Sets the value for this byte string.
 java.lang.String stringValue()
          Retrieves the value of this byte string as a string.
 ASN1OctetString toASN1OctetString()
          Retrieves this byte string as an ASN.1 octet string.
 java.lang.String toString()
          Retrieves a string representation of this byte string.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this byte string to the provided buffer.
 byte[] value()
          Retrieves the value of this byte string as a byte array.
 

Method Detail

value

byte[] value()
Retrieves the value of this byte string as a byte array.

Returns:
The value of this byte string as a byte array.

stringValue

java.lang.String stringValue()
Retrieves the value of this byte string as a string.

Returns:
The value of this byte string as a string.

setValue

void setValue(byte[] value)
Sets the value for this byte string.

Parameters:
value - The value for this byte string.

setValue

void setValue(java.lang.String value)
Sets the value for this byte string.

Parameters:
value - The value for this byte string.

toASN1OctetString

ASN1OctetString toASN1OctetString()
Retrieves this byte string as an ASN.1 octet string.

Returns:
An ASN.1 octet string with the value of this byte string.

toString

java.lang.String toString()
Retrieves a string representation of this byte string.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this byte string.

toString

void toString(java.lang.StringBuilder buffer)
Appends a string representation of this byte string to the provided buffer.

Parameters:
buffer - The buffer to which the information should be appended.

duplicate

ByteString duplicate()
Creates a duplicate of this byte string whose contents can be altered without impacting this byte string.

Returns:
A duplicate of this byte string.