Class GUNZIPMessageProcessor

  extended by
All Implemented Interfaces:
ChainableMessageProcessor, MessageProcessor

public class GUNZIPMessageProcessor
extends Object
implements ChainableMessageProcessor

This MessageProcessor unzips the body of a Message and updates the body with the uncompressed version. It works on byte arrays and InputStream objects. The process method de-compresses an entire byte array and stores the result as a byte array. The chain method updates the InputStream with the Message object's body and wraps it with a GZIPInputStream. This allows the bytes in the stream to be un-zipped on the fly as they are read by an application.

BlackBerry API 6.0.0

Constructor Summary
          Constructs a GUNZIPMessageProcessor.
Method Summary
 InputStream chain(InputStream stream)
          Wraps the InputStream specified with a GZIPInputStream.
 void process(Message message)
          Reads the body of a Message, unzips the data, and updates the body of the message with the resulting de-compressed data.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public GUNZIPMessageProcessor()
Constructs a GUNZIPMessageProcessor.

BlackBerry API 6.0.0

Method Detail


public void process(Message message)
             throws MessageProcessorException
Reads the body of a Message, unzips the data, and updates the body of the message with the resulting de-compressed data. If the message body is very large, you should use the chain method instead.

Specified by:
process in interface MessageProcessor
message - Message to process.
MessageProcessorException - If any problems occur during the unzipping process.
BlackBerry API 6.0.0


public InputStream chain(InputStream stream)
Wraps the InputStream specified with a GZIPInputStream. It can be used to update a Message objects's body InputStream with one that un-zips the message body as the bytes are read from the stream. This is the preferred approach if the message body is large.

Specified by:
chain in interface ChainableMessageProcessor
stream - InputStream to wrap.
InputStream that un-zips the original InputStream.
BlackBerry API 6.0.0

Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.