|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectCADI.Client.Network.JPIPMessageDecoder
public class JPIPMessageDecoder
This class reads JPIP messages as they are defined in ISO/IEC 15444-9
section A.2. Each time the method is
called, only one JPIP message is read. And the method who is calling must be
taken into account when a JPIP End Of Response message is received, then it
must not call the readMessage() method. If it call
after the JPIP End Of Response message is received, a readMessage()IOException
will be thrown.
This class needs a input stram where data are readed from. This class
only needs a read method to read a byte value and
a readFully method to read a byte array.
Usage example:
construct
setParameters
readMessage
....
readMessage
| Field Summary | |
|---|---|
private long |
headerLength
Indicates the length of the JPIP message header. |
(package private) HTTPResponseReader |
inputStreamReader
It is the input stream where data are read from. |
private int |
lastClass
Contains the last Class value. |
private int |
lastCSn
Contains the last CSn value. |
| Constructor Summary | |
|---|---|
JPIPMessageDecoder()
Constructor. |
|
| Method Summary | |
|---|---|
void |
list(java.io.PrintStream out)
Prints this JPIP Message Decoder fields out to the specified output stream. |
private JPIPMessage |
readEORMessage()
Reads the End Of Response message. |
JPIPMessage |
readMessage()
This method is used to read a JPIP messase. |
private long |
readVBAS()
Reads a Variable-length Byte-Aligned Segment. |
void |
setParameters(HTTPResponseReader inputStreamReader)
Sets the input stream where the data are read from. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
HTTPResponseReader inputStreamReader
private int lastClass
private int lastCSn
private long headerLength
| Constructor Detail |
|---|
public JPIPMessageDecoder()
| Method Detail |
|---|
public void setParameters(HTTPResponseReader inputStreamReader)
inputStreamReader - definition in inputStreamReader
public JPIPMessage readMessage()
throws java.net.ProtocolException,
java.io.IOException
JPIPMessage object is built.
JPIPMessage object.
java.net.ProtocolException - if received data can not be decoded correctly.
java.io.IOException - if data can not be read from the input stream. It may
be because the link is broken, the server closed the connection, ...public java.lang.String toString()
toString in class java.lang.Objectpublic void list(java.io.PrintStream out)
out - an output stream.
private long readVBAS()
throws java.io.IOException
java.io.IOException - if an I/O error occurs.
private JPIPMessage readEORMessage()
throws java.io.IOException
java.io.IOException - if an I/O error occurs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||