Generic datagram object defines holder of data sent or received from a
datagram connection.

The DataInput and DataOutput interfaces are extended by
this interface to provide a simple way to read and write binary data in and
out of the datagram buffer. A special method, DatagramBase.reset(), may be called to
reset the read/write point to the beginning of the buffer.

getDatagramStatusListener

Status listener object currently registered to receive events,
or null if no listener registered.

Since:

BlackBerry API 4.0.0

setDatagramId

public void setDatagramId(int datagramId)

Sets datagram ID for this datagram.

Parameters:

datagramID - Dstagram ID to set.

Since:

BlackBerry API 4.0.0

getDatagramId

public int getDatagramId()

Retrieves this datagram's datagram ID.

Returns:

This datagram's datagram ID.

Since:

BlackBerry API 4.0.0

reset

public void reset()

Resets state and data of this datagram.

Use this method to flush this datagram, making it an empty datagram
with a length of 0 bytes, with no properties or flags. The address is
set to null and the registered listener (if present) is removed.

simpleReset

public void simpleReset()

Resets only the state of this datagram

Use this method to remove this datagram's properties and flags. The
address is set to null and the registered listener (if present) is
removed. This method does not flush this datagram's data or alter
its length.

copy

Use this method to copy the data and internal state (poperties,
flags, address) from provied datagram into this datagram.

Sub-classes are expected to override this method for specific
functionality, but should first call super.copy( datagram )
and then copy the subclass-specific material (including any
subclass-specific properties).