Top Description Methods
org.bouncycastle.asn1

public Interface ASN1BitStringParser

extends ASN1Encodable, InMemoryRepresentable
Known Direct Implementers
org.bouncycastle.asn1.BERBitStringParser, org.bouncycastle.asn1.DLBitStringParser, org.bouncycastle.asn1.ASN1BitString
Imports
java.io.IOException, .InputStream

A basic parser for a BIT STRING object

Method Summary

Modifier and TypeMethod and Description
public InputStream

Returns:

an InputStream with its source as the BIT STRING content.
getBitStream
()

Return an InputStream representing the contents of the BIT STRING.

public InputStream

Returns:

an InputStream with its source as the BIT STRING content.
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

Returns:

the number of pad bits. In the range zero to seven.
getPadBits
()

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

Inherited from org.bouncycastle.asn1.ASN1Encodable:
toASN1Primitive
Inherited from org.bouncycastle.asn1.InMemoryRepresentable:
getLoadedObject

Method Detail

getBitStreamback to summary
public InputStream getBitStream() throws IOException

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.

getOctetStreamback to summary
public InputStream getOctetStream() throws IOException

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()

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.