FileDocCategorySizeDatePackage
ASN1OctetString.javaAPI DocAndroid 1.5 API2856Wed May 06 22:41:06 BST 2009org.apache.harmony.security.asn1

ASN1OctetString

public class ASN1OctetString extends ASN1StringType
This class represents ASN.1 octet string type.
see
ASN.1

Fields Summary
private static final ASN1OctetString
ASN1
Constructors Summary
public ASN1OctetString()
Constructs ASN.1 octet string type The constructor is provided for inheritance purposes when there is a need to create a custom ASN.1 octet string type. To get a default implementation it is recommended to use getInstance() method.


                                               
      
        super(TAG_OCTETSTRING);
    
Methods Summary
public java.lang.Objectdecode(BerInputStream in)

        in.readOctetString();

        if (in.isVerify) {
            return null;
        }
        return getDecodedObject(in);
    
public voidencodeContent(BerOutputStream out)

        out.encodeOctetString();
    
public java.lang.ObjectgetDecodedObject(BerInputStream in)
Extracts array of bytes from BER input stream.

param
in - BER input stream
return
array of bytes

        byte[] bytesEncoded = new byte[in.length];
        System.arraycopy(in.buffer, in.contentOffset, bytesEncoded, 0,
                in.length);
        return bytesEncoded;
    
public static org.apache.harmony.security.asn1.ASN1OctetStringgetInstance()
Returns ASN.1 octet string type default implementation The default implementation works with encoding that is represented as byte array.

return
ASN.1 octet string type default implementation

        return ASN1;
    
public voidsetEncodingContent(BerOutputStream out)

        out.length = ((byte[]) out.content).length;