Class DERInputBuffer

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Cloneable

    public class DERInputBuffer
    extends java.io.ByteArrayInputStream
    implements java.lang.Cloneable
    DER input buffer ... this is the main abstraction in the DER library which actively works with the "untyped byte stream" abstraction. It does so with impunity, since it's not intended to be exposed to anyone who could violate the "typed value stream" DER model and hence corrupt the input stream of DER values.
    • Field Summary

      • Fields inherited from class java.io.ByteArrayInputStream

        buf, count, mark, pos
    • Constructor Summary

      Constructors 
      Constructor Description
      DERInputBuffer​(byte[] buf)
      Constructor for DerInputBuffer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      DERInputBuffer dup()
      Duplicate
      boolean equals​(java.lang.Object other)  
      byte[] getBitString()
      Returns the bit string which takes up the rest of this buffer.
      BitArray getUnalignedBitString()
      Returns the bit string which takes up the rest of this buffer.
      BigInt getUnsigned​(int l)
      Returns the unsigned integer which takes up the specified number of bytes in this buffer.
      int hashCode()
      Returns a hashcode for this DerInputBuffer.
      void truncate​(int len)
      Truncate
      • Methods inherited from class java.io.ByteArrayInputStream

        available, close, mark, markSupported, read, read, readAllBytes, readNBytes, reset, skip, transferTo
      • Methods inherited from class java.io.InputStream

        nullInputStream, read, readNBytes
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DERInputBuffer

        public DERInputBuffer​(byte[] buf)
        Constructor for DerInputBuffer
        Parameters:
        buf - the buffer
    • Method Detail

      • dup

        public DERInputBuffer dup()
                           throws java.lang.IllegalArgumentException
        Duplicate
        Returns:
        the buffer
        Throws:
        java.lang.IllegalArgumentException - In case of invalid argument
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        Returns a hashcode for this DerInputBuffer.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        a hashcode for this DerInputBuffer.
      • truncate

        public void truncate​(int len)
                      throws java.io.IOException
        Truncate
        Parameters:
        len - the length
        Throws:
        java.io.IOException - In case of missing data
      • getUnsigned

        public BigInt getUnsigned​(int l)
                           throws java.io.IOException
        Returns the unsigned integer which takes up the specified number of bytes in this buffer.
        Parameters:
        l - the length
        Returns:
        the integer
        Throws:
        java.io.IOException - In case of missing data
      • getBitString

        public byte[] getBitString()
        Returns the bit string which takes up the rest of this buffer. This bit string must be byte-aligned.
        Returns:
        the byte array
      • getUnalignedBitString

        public BitArray getUnalignedBitString()
        Returns the bit string which takes up the rest of this buffer. The bit string need not be byte-aligned.
        Returns:
        the bit array