Microsoft HomeProductsSearchSupportShopWrite Usspacer.gif Microsoft Home
Microsoft Packages
  In this topic

*Constructors

*Methods

 

Packages   Previous Microsoft Packages
Package com.ms.adsi   Previous This
Package

 


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

OctetString

public OctetString(byte[] inArr) throws IADsException;

The constructor takes an array of bytes and this is a read only member.

ParameterDescription
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

encodedString 

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.

getBytes 

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.

toString 

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.

Back To Top © 1997 Microsoft Corporation. All rights reserved. Terms of use.