net.rim.pushsdk.commons.content
Class GenericContent
java.lang.Object
net.rim.pushsdk.commons.content.Content
net.rim.pushsdk.commons.content.SinglePartContent
net.rim.pushsdk.commons.content.GenericContent
public class GenericContent
- extends SinglePartContent
Content payload that does not fit one of the predefined content types.
You must set the content MIME type and any headers manually.
- Author:
- mdicesare
|
Constructor Summary |
GenericContent(byte[] content,
ContentType contentType)
Creates generic content with the specified byte array as the payload and uses the given content type to set the content
type header. |
|
Method Summary |
boolean |
isEmpty()
Determines whether the content is empty. |
String |
toString()
Constructs a String with all attributes in name = value format. |
protected void |
writeContentTo(ByteArrayOutputStream out)
Note: Printing generic content does not do any character set encoding. |
GenericContent
public GenericContent(byte[] content,
ContentType contentType)
- Creates generic content with the specified byte array as the payload and uses the given content type to set the content
type header.
- Parameters:
content - the payloadcontentType - the content MIME type
writeContentTo
protected void writeContentTo(ByteArrayOutputStream out)
throws IOException
- Note: Printing generic content does not do any character set encoding. It is assumed that the byte array has already been
encoded in the desired encoding (if needed).
- Specified by:
writeContentTo in class SinglePartContent
- Parameters:
out - the output stream
- Throws:
IOException - if any IO errors occur writing to the output stream
isEmpty
public boolean isEmpty()
- Description copied from class:
Content
- Determines whether the content is empty.
- Specified by:
isEmpty in class Content
- Returns:
- true if the content is deemed to be empty; false otherwise
toString
public String toString()
- Constructs a
String with all attributes in name = value format.
- Overrides:
toString in class Content
- Returns:
- a
String representation of this object.
Copyright © 2011 Research In Motion. All Rights Reserved.