com.unboundid.util
Interface ByteString

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
ASN1OctetString

@NotExtensible
@ThreadSafety(level=INTERFACE_THREADSAFE)
public interface ByteString
extends java.io.Serializable

This interface defines a set of methods for treating a value as either a string or byte array.


Method Summary
 void appendValueTo(ByteStringBuffer buffer)
          Appends the value of this byte string to the provided buffer.
 byte[] getValue()
          Retrieves a byte array containing the binary value for this byte string.
 java.lang.String stringValue()
          Retrieves the value for this byte string as a String.
 ASN1OctetString toASN1OctetString()
          Converts this byte string to an ASN.1 octet string.
 

Method Detail

getValue

byte[] getValue()
Retrieves a byte array containing the binary value for this byte string.

Returns:
A byte array containing the binary value for this byte string.

stringValue

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

Returns:
The value for this byte string as a String.

appendValueTo

void appendValueTo(ByteStringBuffer buffer)
Appends the value of this byte string to the provided buffer. It must not use the ByteStringBuffer.append(ByteString) method, since that method relies on this method.

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

toASN1OctetString

ASN1OctetString toASN1OctetString()
Converts this byte string to an ASN.1 octet string.

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