|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.rim.blackberry.api.bbm.platform.io.BBMPlatformData
The BBMPlatformData class represents the data to be sent to or received
from a BBMPlatformContact using a BBMPlatformChannel or BBMPlatformSession.
An instance of BBMPlatformData contains data stored as byte[],
an optional content type and an optional ID.
Some constructors provide a convenient way to encode the data from String to byte[],
using the UTF-8 encoding.
The content type and ID are defined and used only by the application and not by BBM.
| Constructor Summary | ||
BBMPlatformData(byte[] data)
Constructs a BBMPlatformData to be sent using BBMPlatformChannel or BBMPlatformSession. |
||
BBMPlatformData(String data)
Constructs a BBMPlatformData to be sent using BBMPlatformChannel or BBMPlatformSession. |
||
BBMPlatformData(String contentType,
byte[] data)
Constructs a BBMPlatformData to be sent using BBMPlatformChannel or BBMPlatformSession. |
||
BBMPlatformData(String contentType,
byte[] data,
int id)
Constructs a BBMPlatformData to be sent using BBMPlatformChannel or BBMPlatformSession. |
||
BBMPlatformData(String contentType,
String data)
Constructs a BBMPlatformData to be sent using BBMPlatformChannel or BBMPlatformSession. |
||
| Method Summary | ||
String |
getContentType()
Retrieves the application-defined content type |
|
byte[] |
getData()
Retrieves the data that is sent or received |
|
String |
getDataAsString()
Retrieves the data that is sent or received, decoding the data to a String
using the UTF-8 encoding. |
|
int |
getId()
Retrieves the application-defined ID for the data |
|
| Constructor Detail |
public BBMPlatformData(byte[] data)
BBMPlatformChannel or BBMPlatformSession.data - data to be sentNullPointerException - if data is nullpublic BBMPlatformData(String data)
BBMPlatformChannel or BBMPlatformSession.
This method converts the given String to byte[] using the UTF-8 encoding.
Note that the encoding can be inefficient in space depending on the characters in the String.data - String to be sent, converted to byte[] by data.getBytes()NullPointerException - if data is nullpublic BBMPlatformData(String contentType, byte[] data)
BBMPlatformChannel or BBMPlatformSession.contentType - a short application-defined typedata - data to be sentNullPointerException - if data is nullIllegalArgumentException - if contentType is longer than 10 characterspublic BBMPlatformData(String contentType, byte[] data, int id)
BBMPlatformChannel or BBMPlatformSession.contentType - a short application-defined typedata - data to be sentid - an application-defined ID assigned to the dataNullPointerException - if data is nullIllegalArgumentException - if contentType is longer than 10 characterspublic BBMPlatformData(String contentType, String data)
BBMPlatformChannel or BBMPlatformSession.
This method converts the given String to byte[] using the default character encoding
(ISO-8859-1). Note that the encoding can be inefficient in space depending on the characters in the String.contentType - a short application-defined typedata - String to be sent, converted to byte[] by data.getBytes()NullPointerException - if data is nullIllegalArgumentException - if contentType is longer than 10 characters| Method Detail |
public String getContentType()
"" if not definedpublic byte[] getData()
public String getDataAsString()
String
using the UTF-8 encoding.public int getId()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999- Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.