Package org.bouncycastle.asn1
Interface ASN1BitStringParser
- All Superinterfaces:
ASN1Encodable
,InMemoryRepresentable
- All Known Implementing Classes:
ASN1BitString
,BERBitString
,BERBitStringParser
,DERBitString
,DLBitString
,DLBitStringParser
,NetscapeCertType
,ReasonFlags
A basic parser for a BIT STRING object
-
Method Summary
Modifier and TypeMethodDescriptionReturn an InputStream representing the contents of the BIT STRING.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).int
Return the number of pad bits, if any, in the final byte, if any, read fromgetBitStream()
.Methods inherited from interface org.bouncycastle.asn1.ASN1Encodable
toASN1Primitive
Methods inherited from interface org.bouncycastle.asn1.InMemoryRepresentable
getLoadedObject
-
Method Details
-
getBitStream
Return an InputStream representing the contents of the BIT STRING. The final byte, if any, may include pad bits. SeegetPadBits()
.- Returns:
- an InputStream with its source as the BIT STRING content.
- Throws:
IOException
-
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:
- an InputStream with its source as the BIT STRING content.
- Throws:
IOException
-
getPadBits
int getPadBits()Return the number of pad bits, if any, in the final byte, if any, read fromgetBitStream()
. 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 ifgetOctetStream()
was used instead ofgetBitStream()
).- Returns:
- the number of pad bits. In the range zero to seven.
-