Top Description Fields Constructors Methods
org.bouncycastle.asn1

public Class BERBitStringParser

extends Object
implements ASN1BitStringParser
Class Inheritance
All Implemented Interfaces
org.bouncycastle.asn1.ASN1BitStringParser, org.bouncycastle.asn1.InMemoryRepresentable, org.bouncycastle.asn1.ASN1Encodable
Imports
java.io.IOException, .InputStream, org.bouncycastle.util.io.Streams

Deprecated

Check for 'ASN1BitStringParser' instead

A parser for indefinite-length BIT STRINGs.

Field Summary

Modifier and TypeField and Description
private ConstructedBitStream
private ASN1StreamParser

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public InputStream
getBitStream()

Implements org.bouncycastle.asn1.ASN1BitStringParser.getBitStream.

Return an InputStream representing the contents of the BIT STRING.

public ASN1Primitive
getLoadedObject()

Implements org.bouncycastle.asn1.InMemoryRepresentable.getLoadedObject.

Get the in-memory representation of the ASN.1 object.

public InputStream
getOctetStream()

Implements org.bouncycastle.asn1.ASN1BitStringParser.getOctetStream.

Return an InputStream representing the contents of the BIT STRING, where the content is expected to be octet-aligned (this will be automatically checked during parsing).

public int
getPadBits()

Implements org.bouncycastle.asn1.ASN1BitStringParser.getPadBits.

Return the number of pad bits, if any, in the final byte, if any, read from getBitStream().

pack-priv static BERBitString
public ASN1Primitive
toASN1Primitive()

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Return an object, possibly constructed, of ASN.1 primitives

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_bitStreamback to summary
private ConstructedBitStream _bitStream
_parserback to summary
private ASN1StreamParser _parser

Constructor Detail

BERBitStringParserback to summary
pack-priv BERBitStringParser(ASN1StreamParser parser)

Method Detail

getBitStreamback to summary
public InputStream getBitStream() throws IOException

Implements org.bouncycastle.asn1.ASN1BitStringParser.getBitStream.

Doc from org.bouncycastle.asn1.ASN1BitStringParser.getBitStream.

Return an InputStream representing the contents of the BIT STRING. The final byte, if any, may include pad bits. See getPadBits().

Returns:InputStream

an InputStream with its source as the BIT STRING content.

getLoadedObjectback to summary
public ASN1Primitive getLoadedObject() throws IOException

Implements org.bouncycastle.asn1.InMemoryRepresentable.getLoadedObject.

Doc from org.bouncycastle.asn1.InMemoryRepresentable.getLoadedObject.

Get the in-memory representation of the ASN.1 object.

Returns:ASN1Primitive

an ASN1Primitive representing the loaded object.

Exceptions
IOException:
for bad input data.
getOctetStreamback to summary
public InputStream getOctetStream() throws IOException

Implements org.bouncycastle.asn1.ASN1BitStringParser.getOctetStream.

Doc from org.bouncycastle.asn1.ASN1BitStringParser.getOctetStream.

Return an InputStream representing the contents of the BIT STRING, where the content is expected to be octet-aligned (this will be automatically checked during parsing).

Returns:InputStream

an InputStream with its source as the BIT STRING content.

getPadBitsback to summary
public int getPadBits()

Implements org.bouncycastle.asn1.ASN1BitStringParser.getPadBits.

Doc from org.bouncycastle.asn1.ASN1BitStringParser.getPadBits.

Return the number of pad bits, if any, in the final byte, if any, read from getBitStream(). This number is in the range zero to seven. That number of the least significant bits of the final byte, if any, are not part of the contents and should be ignored.

Note

Must be called AFTER the stream has been fully processed. (Does not need to be called if getOctetStream() was used instead of getBitStream()).

Returns:int

the number of pad bits. In the range zero to seven.

parseback to summary
pack-priv static BERBitString parse(ASN1StreamParser sp) throws IOException
toASN1Primitiveback to summary
public ASN1Primitive toASN1Primitive()

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Doc from org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Return an object, possibly constructed, of ASN.1 primitives

Returns:ASN1Primitive

an ASN.1 primitive.