BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 06-01-2009, 07:42 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2009
Model: 8100
PIN: N/A
Carrier: vodafone
Posts: 33
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Compress and Decompress using GZIP

Please Login to Remove!

Hi,
I want to compress and decompress data using gzip algorithm.

Please help,how do I achieve it?
Offline  
Old 06-01-2009, 09:55 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

you can use GZIPInputStream and GZIPOutputStream like you would other in/out streams to read and write.
Offline  
Old 06-02-2009, 02:49 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2009
Model: 8100
PIN: N/A
Carrier: vodafone
Posts: 33
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Bemshaswing,
Thanks for the reply.
I have tried using GZIPInputStream and GZIPOutputStream.

It will be gr8 if someone provides me with sample code
Offline  
Old 06-02-2009, 09:17 AM   #4 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

here's an example of how it's done in standard java link

which doesn't differ greatly from gZip reading of inputStream
Code:
StringBuffer rawResponse = new StringBuffer();
InputStream inputStream = //some input stream
	GZIPInputStream gzipInputStream = new GZIPInputStream(inputStream);
				while (-1 != (length = gzipInputStream.read(responseData))) {
					rawResponse.append(new String(responseData, 0, length));
				
				}
Offline  
Old 06-04-2009, 05:37 AM   #5 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2009
Model: 8100
PIN: N/A
Carrier: vodafone
Posts: 33
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Bemshaswing,
Thanks for the reply.
It worked for me.

Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

PLCC Puller IC Motherboard Circuit Board Extractor Tool
$2.51
PLCC Puller IC Motherboard Circuit Board Extractor Tool pictureJAVELIN Fuji Luxel T9800 CTP Motherboard IMB 100023519V00 S/N 0460
$330.0
JAVELIN Fuji Luxel T9800 CTP Motherboard IMB 100023519V00 S/N 0460 pictureFANUC 11 MOTHER BOARD #A02B-0078-B501 with/with out CIRCUIT BOARDS :ACP, BMU, PS
$800.0
FANUC 11 MOTHER BOARD #A02B-0078-B501 with/with out CIRCUIT BOARDS :ACP, BMU, PS picture MOTHER BOARD #A16B-1010-020. 0/05B w/wo circuit boards ROM/RAM, ACP, BMU, PS
$850.0
 MOTHER BOARD #A16B-1010-020. 0/05B w/wo circuit boards ROM/RAM, ACP, BMU, PS pictureMOTHER BOARD #A16B-1010-0050/15C w/wo DAUGHTER BOARDS
$700.0
MOTHER BOARD #A16B-1010-0050/15C  w/wo DAUGHTER BOARDS picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.