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

ASN1Enumerated

public class ASN1Enumerated extends ASN1Primitive
This class represents ASN.1 Enumerated type.
see
ASN.1

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


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

        in.readEnumerated();

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

        out.encodeInteger();
    
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.ASN1EnumeratedgetInstance()
Returns ASN.1 Enumerated type default implementation The default implementation works with encoding that is represented as byte array.

return
ASN.1 Enumerated type default implementation

        return ASN1;
    
public voidsetEncodingContent(BerOutputStream out)

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