FileDocCategorySizeDatePackage
CBSPacket.javaAPI DocphoneME MR2 API (J2ME)3519Wed May 02 18:00:32 BST 2007com.sun.tck.wma.cbs

CBSPacket

public class CBSPacket extends com.sun.tck.wma.sms.MessagePacket
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.

Fields Summary
Constructors Summary
public CBSPacket()
Construct a new CBS data packet with no payload (Empty data stream.).

        super();
    
public CBSPacket(byte[] payload)
Construct a new CBS data packet with a data stream (payload)..

param
payload The array of bytes representing the CBS data.

        super(payload);
    
Methods Summary
public intgetEncodingType()
Get the encoding type from the data stream.

return
The encoding type.

        return getInt();
    
public byte[]getMessage(int len)
Get the message bytes from the data stream.

param
len The number of bytes to read from the stream.
return
The array of bytes read from the data stream.

        return getBytes(len);
    
public intgetMessageID()
Get the message ID from the data stream..

return
The message ID.

        return getInt();
    
public intgetMessageLength()
Get the length, in bytes, of the message from the data stream.

return
The length of the message.

        return getInt();
    
public voidsetEncodingType(int type)
Write the encoding type to the data stream. The type can be text, ucs2, binary.

param
type The encoding type.

        putInt(type);
    
public voidsetMessage(byte[] msg)
Write the message bytes to the data stream.

param
msg The array of bytes to write.

        putBytes(msg);
    
public voidsetMessageID(int msgID)
Set the message ID, or the channel to listen to, in the data stream..

param
msgID The message ID.

        putInt(msgID);
    
public voidsetMessageLength(int msgLen)
Write the length of the message in the data stream..

param
msgLen The length, in bytes, of the CBS payload.

        putInt(msgLen);