Code example for Enumeration

Methods: hasMoreElements, nextElement

0
 
    private ContentInfo(ASN1Sequence asn1sequence) 
    { 
        isBer = true; 
        Enumeration enumeration = asn1sequence.getObjects(); 
        contentType = (ASN1ObjectIdentifier)enumeration.nextElement(); 
        if(enumeration.hasMoreElements()) 
            content = ((ASN1TaggedObject)enumeration.nextElement()).getObject(); 
        isBer = asn1sequence instanceof BERSequence; 
    } 
 
    public ContentInfo(ASN1ObjectIdentifier asn1objectidentifier, ASN1Encodable asn1encodable) 
    { 
        isBer = true; 
        contentType = asn1objectidentifier; 
        content = asn1encodable; 
    } 
 
    public ASN1ObjectIdentifier getContentType() 
    { 
        return contentType;