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

ASN1BitString

public class ASN1BitString extends ASN1StringType
This class represents ASN.1 Bitstring type.
see
ASN.1

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


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


        in.readBitString();

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

        out.encodeBitString();
    
public java.lang.ObjectgetDecodedObject(BerInputStream in)
Extracts BitString object from BER input stream.

param
in - BER input stream
return
BitString object

        byte[] bytes = new byte[in.length - 1];
        System.arraycopy(in.buffer, in.contentOffset + 1, bytes, 0,
                in.length - 1);
        return new BitString(bytes, in.buffer[in.contentOffset]);
    
public static org.apache.harmony.security.asn1.ASN1BitStringgetInstance()
Returns ASN.1 Bitstring type default implementation The default implementation works with encoding that is represented as BitString object.

return
ASN.1 Bitstring type default implementation
see
org.apache.harmony.security.asn1.BitString

        return ASN1;
    
public voidsetEncodingContent(BerOutputStream out)

        out.length = ((BitString) out.content).bytes.length + 1;