Class DERInputBuffer
- java.lang.Object
-
- java.io.InputStream
-
- java.io.ByteArrayInputStream
-
- com.github.toolarium.security.rsa.der.DERInputBuffer
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Cloneable
public class DERInputBuffer extends java.io.ByteArrayInputStream implements java.lang.CloneableDER 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.
-
-
Constructor Summary
Constructors Constructor Description DERInputBuffer(byte[] buf)Constructor for DerInputBuffer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DERInputBufferdup()Duplicatebooleanequals(java.lang.Object other)byte[]getBitString()Returns the bit string which takes up the rest of this buffer.BitArraygetUnalignedBitString()Returns the bit string which takes up the rest of this buffer.BigIntgetUnsigned(int l)Returns the unsigned integer which takes up the specified number of bytes in this buffer.inthashCode()Returns a hashcode for this DerInputBuffer.voidtruncate(int len)Truncate
-
-
-
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:
equalsin classjava.lang.Object- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
Returns a hashcode for this DerInputBuffer.- Overrides:
hashCodein classjava.lang.Object- Returns:
- a hashcode for this DerInputBuffer.
-
truncate
public void truncate(int len) throws java.io.IOExceptionTruncate- 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
-
-