| java.lang.Object com.sun.tck.wma.sms.MessagePacket com.sun.tck.wma.cbs.CBSPacket
CBSPacket | public class CBSPacket extends MessagePacket (Code) | | A CBS data packet which is the interface between an application and the data
stream. Methods are included to read/write data from/to the data stream, in
CBS format.
|
Constructor Summary | |
public | CBSPacket() Construct a new CBS data packet with no payload (Empty data stream.). | public | CBSPacket(byte[] payload) Construct a new CBS data packet with a data stream (payload).. |
Method Summary | |
public int | getEncodingType() Get the encoding type from the data stream. | public byte[] | getMessage(int len) Get the message bytes from the data stream.
Parameters: len - The number of bytes to read from the stream. | public int | getMessageID() Get the message ID from the data stream.. | public int | getMessageLength() Get the length, in bytes, of the message from the data stream. | public void | setEncodingType(int type) Write the encoding type to the data stream. | public void | setMessage(byte[] msg) Write the message bytes to the data stream. | public void | setMessageID(int msgID) Set the message ID, or the channel to listen to, in the data stream.. | public void | setMessageLength(int msgLen) Write the length of the message in the data stream.. |
CBSPacket | public CBSPacket()(Code) | | Construct a new CBS data packet with no payload (Empty data stream.).
|
CBSPacket | public CBSPacket(byte[] payload)(Code) | | Construct a new CBS data packet with a data stream (payload)..
Parameters: payload - The array of bytes representing the CBS data. |
getEncodingType | public int getEncodingType()(Code) | | Get the encoding type from the data stream.
The encoding type. |
getMessage | public byte[] getMessage(int len)(Code) | | Get the message bytes from the data stream.
Parameters: len - The number of bytes to read from the stream. The array of bytes read from the data stream. |
getMessageID | public int getMessageID()(Code) | | Get the message ID from the data stream..
The message ID. |
getMessageLength | public int getMessageLength()(Code) | | Get the length, in bytes, of the message from the data stream.
The length of the message. |
setEncodingType | public void setEncodingType(int type) throws IOException(Code) | | Write the encoding type to the data stream. The type can be text,
ucs2, binary.
Parameters: type - The encoding type. |
setMessage | public void setMessage(byte[] msg) throws IOException(Code) | | Write the message bytes to the data stream.
Parameters: msg - The array of bytes to write. |
setMessageID | public void setMessageID(int msgID) throws IOException(Code) | | Set the message ID, or the channel to listen to, in the data stream..
Parameters: msgID - The message ID. |
setMessageLength | public void setMessageLength(int msgLen) throws IOException(Code) | | Write the length of the message in the data stream..
Parameters: msgLen - The length, in bytes, of the CBS payload. |
|
|