|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.slamd.asn1.ASN1Reader
This class provides a mechanism for reading ASN.1 elements from an input
stream. It is not a true java.io.Reader, but it should be good
enough for most purposes.
| Field Summary | |
static int |
BUFFER_SIZE
The size of the buffer that will be used for reading in data. |
| Constructor Summary | |
ASN1Reader(java.io.InputStream inputStream)
Creates a new ASN.1 reader to read elements from the specified input stream. |
|
ASN1Reader(java.net.Socket socket)
Creates a new ASN.1 reader to read elements from the input stream of the provided socket. |
|
| Method Summary | |
int |
available()
Retrieves the number of bytes that can be read without blocking. |
void |
close()
Closes this ASN.1 reader. |
ASN1Element |
readElement()
Reads an ASN.1 element from the provided input stream. |
ASN1Element |
readElement(int timeout)
Reads an ASN.1 element from the provided input stream, waiting a maximum of timeout milliseconds for the response. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int BUFFER_SIZE
| Constructor Detail |
public ASN1Reader(java.io.InputStream inputStream)
inputStream - The input stream from which ASN.1 elements are to be
read.
public ASN1Reader(java.net.Socket socket)
throws java.io.IOException
socket - The network socket from which the ASN.1 elements are to be
read.
java.io.IOException - If the socket's input stream cannot be obtained.| Method Detail |
public int available()
throws java.io.IOException
java.io.IOException - If a problem occurs while trying to make the
determination.
public ASN1Element readElement()
throws ASN1Exception,
java.io.IOException
ASN1Exception - If the data read from the input stream does not
contain a valid ASN.1 element.
java.io.IOException - If there is a problem reading the information from
the input stream.
public ASN1Element readElement(int timeout)
throws ASN1Exception,
java.io.InterruptedIOException,
java.io.IOException
timeout milliseconds for the response. If no response has
been received during that time, then an InterruptedIOException
will be thrown. Note that this is only applicable to ASN.1 readers that
were created using the version of the constructor that accepts a socket as
the argument. If no socket has been provided, then no timeout will be
used.
timeout - The maximum length of time in milliseconds that the read
operation will be allowed to block while waiting for
information.
ASN1Exception - If the data read from the input stream does not
contain a valid ASN.1 element.
java.io.InterruptedIOException - If the read was interrupted because the
timeout was reached.
java.io.IOException - If there is a problem reading the information from
the input stream or setting a timeout on the socket.
public void close()
throws java.io.IOException
java.io.IOException - If a problem occurs while closing the ASN.1 reader.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||