Class ASN1BitString

    • Method Detail

      • getInstance

        public static ASN1BitString getInstance​(java.lang.Object obj)
      • getPadBits

        protected static int getPadBits​(int bitString)
        Parameters:
        bitString - an int containing the BIT STRING
        Returns:
        the correct number of pad bits for a bit string defined in a 32 bit constant
      • getBytes

        protected static byte[] getBytes​(int bitString)
        Parameters:
        bitString - an int containing the BIT STRING
        Returns:
        the correct number of bytes for a bit string defined in a 32 bit constant
      • getBitStream

        public java.io.InputStream getBitStream()
                                         throws java.io.IOException
        Description copied from interface: ASN1BitStringParser
        Return an InputStream representing the contents of the BIT STRING. The final byte, if any, may include pad bits. See ASN1BitStringParser.getPadBits().
        Specified by:
        getBitStream in interface ASN1BitStringParser
        Returns:
        an InputStream with its source as the BIT STRING content.
        Throws:
        java.io.IOException
      • getOctetStream

        public java.io.InputStream getOctetStream()
                                           throws java.io.IOException
        Description copied from interface: ASN1BitStringParser
        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).
        Specified by:
        getOctetStream in interface ASN1BitStringParser
        Returns:
        an InputStream with its source as the BIT STRING content.
        Throws:
        java.io.IOException
      • getString

        public java.lang.String getString()
        Return a String representation of this BIT STRING
        Specified by:
        getString in interface ASN1String
        Returns:
        a String representation.
      • intValue

        public int intValue()
        Returns:
        the value of the bit string as an int (truncating if necessary)
      • getOctets

        public byte[] getOctets()
        Return the octets contained in this BIT STRING, checking that this BIT STRING really does represent an octet aligned string. Only use this method when the standard you are following dictates that the BIT STRING will be octet aligned.
        Returns:
        a copy of the octet aligned data.
      • getBytes

        public byte[] getBytes()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object