|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectits.backbone.frame.ItsFrame
Fundamental low-level unit of network communication for ITS applications. Contains methods to read and write the frame header and data to a stream.
| Field Summary | |
static int |
FLAG_COMPRESSED
If FLAG_COMPRESSED is set in the ItsFrame header flag field, then the frame has been compressed with GZIPOutputStream. |
| Constructor Summary | |
ItsFrame()
Constructs null ITS frame. |
|
ItsFrame(java.io.InputStream is)
Constructs ITS frame and reads its contents from an ITS stream. |
|
ItsFrame(ItsInputStream is)
|
|
ItsFrame(short newType,
byte[] newData)
Constructs an ITS frame with the type as a parameter, reading the data from a byte array. |
|
ItsFrame(short newType,
ItsData newData)
Constructs an ITS frame with the type as a parameter, reading the data from an ItsData It is anticipated that this constructor will be used to create an ITS frame for output using existing data. |
|
| Method Summary | |
byte[] |
getData()
Returns the data portion of the frame as a byte array. |
int |
getDataLength()
Returns the length of the data portion of the frame (which may be zero). |
int |
getFlags()
|
short |
getTimeout()
|
ItsFrameType |
getType()
Returns the ITS Frame type |
int |
getVersion()
|
short |
getXid()
Returns the transaction ID |
void |
read(java.io.InputStream is)
Reads the frame from an InputStream |
void |
setData(byte[] newData)
Sets the data portion of the frame to a new byte array (which may be null) |
void |
setFlags(int flags)
|
void |
setTimeout(short s)
|
void |
setXid(short theXid)
Sets the Xid |
void |
write(java.io.DataOutput do_)
Writes an ITS frame to an OutputStream |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int FLAG_COMPRESSED
| Constructor Detail |
public ItsFrame()
public ItsFrame(java.io.InputStream is)
throws java.io.IOException,
BadMagicException
java.io.IOException - io error
BadMagicException - if the magic number is incorrect
public ItsFrame(ItsInputStream is)
throws java.io.IOException,
BadMagicException
public ItsFrame(short newType,
byte[] newData)
java.io.IOException - io error
public ItsFrame(short newType,
ItsData newData)
| Method Detail |
public void setData(byte[] newData)
newData - byte[], the data to be added to the framepublic byte[] getData()
public int getDataLength()
public ItsFrameType getType()
public int getFlags()
public void setFlags(int flags)
public short getXid()
public void setXid(short theXid)
theXid - new Xid valuepublic short getTimeout()
public void setTimeout(short s)
public int getVersion()
public void read(java.io.InputStream is)
throws java.io.IOException,
BadMagicException
java.io.IOException - io error
BadMagicException - bad magic number in header
public void write(java.io.DataOutput do_)
throws java.io.IOException
java.io.IOException - io error
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||