AsnInputStream extends InputStream { public byte[] readSequence() throws AsnException, IOException { int length = readLength(); return this.readSequenceData(length); } AsnInputStream( byte[] buf );  AsnInputStream( byte[] buf, int tagClass, boolean isPrimitive, int tag ); protected  AsnInputStream( AsnInputStream buf, int start, int length ); @Deprecated  AsnInputStream(InputStream in); int position(); void position( int newPosition ); @Override int available(); void advance(int byteCount); @Override long skip(long n); @Override boolean markSupported(); @Override int read(); @Override int read(byte[] b, int off, int len); @Override int read(byte[] b); int readTag(); int getTagClass(); int getTag(); boolean isTagPrimitive(); int readLength(); AsnInputStream readSequenceStream(); byte[] readSequence(); AsnInputStream readSequenceStreamData(int length); byte[] readSequenceData(int length); AsnInputStream readSequenceIndefinite(); byte[] readIndefinite(); void advanceElement(); void advanceElementData(int length); boolean readBoolean(); boolean readBooleanData(int length); long readInteger(); long readIntegerData(int length); double readReal(); double readRealData(int length); BitSetStrictLength readBitString(); BitSetStrictLength readBitStringData(int length); @Deprecated void readBitString(BitSet bitSet); @Deprecated void readBitStringData(BitSet bitSet, int length); @Deprecated void readBitStringData(BitSet bitSet, int length, boolean isTagPrimitive); byte[] readOctetString(); @Deprecated void readOctetString(OutputStream outputStream); byte[] readOctetStringData(int length); @Deprecated void readOctetStringData(OutputStream outputStream, int length); @Deprecated void readOctetStringData(OutputStream outputStream, int length, boolean isTagPrimitive); void readNull(); void readNullData(int length); long[] readObjectIdentifier(); long[] readObjectIdentifierData(int length); String readIA5String(); String readIA5StringData(int length); String readUTF8String(); String readUTF8StringData(int length); String readGraphicString(); String readGraphicStringData(int length); @Override String toString();  }
@Test public void testReadSequence() throws Exception { AsnInputStream asnIs = new AsnInputStream(definiteSeqData()); int tag = asnIs.readTag(); AsnInputStream asnIs2 = asnIs.readSequenceStream(); testSeqData(tag, asnIs2, asnIs); asnIs = new AsnInputStream(definiteSeqData()); tag = asnIs.readTag(); int length = asnIs.readLength(); asnIs2 = asnIs.readSequenceStreamData(length); testSeqData(tag, asnIs2, asnIs); asnIs = new AsnInputStream(indefiniteSeqData()); tag = asnIs.readTag(); asnIs2 = asnIs.readSequenceStream(); testSeqData(tag, asnIs2, asnIs); asnIs = new AsnInputStream(definiteSeqData()); tag = asnIs.readTag(); byte[] bfRes = asnIs.readSequence(); testSeqData(tag, bfRes, asnIs); asnIs = new AsnInputStream(definiteSeqData()); tag = asnIs.readTag(); length = asnIs.readLength(); bfRes = asnIs.readSequenceData(length); testSeqData(tag, bfRes, asnIs); asnIs = new AsnInputStream(indefiniteSeqData()); tag = asnIs.readTag(); bfRes = asnIs.readSequence(); testSeqData(tag, bfRes, asnIs); }