|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.InputStream | +--java.io.FilterInputStream | +--iaik.utils.TracedInputStream
A TracedInputStream traces all the data which is read from an InputStream.
Method getTracedData()
returns an array,
which contains the data read from an InputStream. A TracedInputStream is useful when
a decoder reads from an InputStream and the encoded data is also needed.
For example:
// the InputStream containing a DER encoded ASN.1 object: InputStream is; TracedInputStream tis = new TracedInputStream(is); // read and decode the next encoded ASN.1 object from is: ASN1Object asn1_obj = DerCoder.decode(tis); // get the encoded bytes which have been read from is: byte[] raw = tis.getTracedData(); ...
Fields inherited from class java.io.FilterInputStream |
in |
Constructor Summary | |
TracedInputStream(InputStream is)
Constructs a TracedInputStream from the InputStream which should be traced. |
|
TracedInputStream(InputStream is,
int initialSize)
Constructs a TracedInputStream from the InputStream which should be traced. |
Method Summary | |
byte[] |
getTracedData()
Returns the data which have been read from the InputStream. |
int |
read()
Reads the next byte from this stream and returns it as int value between 0 and 255. |
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes from this stream into the given byte array.
|
Methods inherited from class java.io.FilterInputStream |
available, close, mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TracedInputStream(InputStream is)
is
- - the input stream.public TracedInputStream(InputStream is, int initialSize)
is
- - the input stream.Method Detail |
public int read(byte[] b, int off, int len) throws IOException
len
bytes from this stream into the given byte array.
read
in class FilterInputStream
b
- the byte array to which to read the dataoff
- the offset indicating the start position within the destination byte
array, to which the data is writtenlen
- the maximum number of bytes to be readIOException
- if an I/O error occurspublic int read() throws IOException
read
in class FilterInputStream
IOException
- if an I/O error occurspublic byte[] getTracedData()
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |