Class OctetString
public class OctetString
{
// Constructors
public OctetString(byte[] inArr) throws IADsException;
// Methods
public String encodedString();
public byte[] getBytes();
public String toString();
}
This class represents Octet Strings. It is a wrapper for an array of bytes and is provided to simplify the usage of the Octet String ADsType.
Also see Also Active Directory Design Specification Version 2.0
Constructors
public OctetString(byte[] inArr) throws IADsException;
The constructor takes an array of bytes and this is a read only member.
| Parameter | Description |
| inArr, | an array of bytes. The OctetString object created will correspond to the bytes in this array.
|
Exceptions
IADsException,
if unable to create object.
Methods
public String encodedString();
This method returns a String representing the data stored by this OctetString object. It corresponds to the ADsEncodeBinaryData in ADSI. This function would typically be used in setting search filters.
Return Value
Returns codedString, String representing data held by object.
public byte[] getBytes();
Returns an array of bytes. Note that the byte array is a copy of the internal representation and therefore changes will not affect the values in the OctetString object.
Return Value
Returns byteArray, an array of bytes.
public String toString();
Returns a string represenationg the array of bytes. For example if the byte[] = { 1,15,31,4 }; then toString will return "OctetString@1#15#31#4".
Return Value
Returns stringRepresentation of the OctetString.