* @param datagramConnectionBase
* The DatagramConnectionBase object with which to create the Datagram from
* @return The Datagram object representing the SMS message
*/
public Datagram toDatagram( DatagramConnectionBase datagramConnectionBase ) throws IOException {
DatagramBase datagram = null;
byte[] data = _body.getBytes( "ISO-8859-1" );
datagram = (DatagramBase) datagramConnectionBase.newDatagram();
SmsAddress smsAddress = new SmsAddress( "//" + _phoneNumber );
SMSPacketHeader smsPacketHeader = smsAddress.getHeader();
smsPacketHeader.setMessageCoding( SMSPacketHeader.MESSAGE_CODING_ISO8859_1 );
datagram.setAddressBase( smsAddress );
datagram.write( data, 0, data.length );
return datagram;
}