Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Sevottharte
Posts: 7
Registered: ‎05-09-2012
My Device: Not Specified
My Carrier: Not Specified

Searching a way to manipulate 7-zip, zip and rar archives

Hey guys, I'm new 'round here and I'm searching in the forum for a way to manipulate .zip, .rar and 7-zip archives. But without success yet. 

I've found that thing, gzip (GNU zip), but it doesn't work with .rar or .zip (because of the codification, I guess...). Someone suggested the zipMe. Maybe there's something new that I didn't find, I'm still searching.

 

Can somebody help me with a tip or something like that?

 

Grateful for any help, in advance.

Please use plain text.
Developer
simon_hain
Posts: 16,102
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Searching a way to manipulate 7-zip, zip and rar archives

welcome to the forums!

there is no native support for these types, only gzip is supported. if you have full control over both sides you can just use that, otherwise you'll need a library.
i have heard of http://sourceforge.net/projects/zipme/ but never used it, just as an example.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
New Developer
Sevottharte
Posts: 7
Registered: ‎05-09-2012
My Device: Not Specified
My Carrier: Not Specified

Re: Searching a way to manipulate 7-zip, zip and rar archives

simon_hain, thank you for greeting and your sugestions.

 

I'm searching for a way to read a serie of compressed images in .rar/.zip/.7zip archives (I don't know if it is possible). If there's no way to read inside them, maybe can I just decompress them. 

 

I'll keep searching for libs for .7zip and .rar archives, for now I'll try use java.util.zip for .zip and .gzip archives. I don't know if it's fast. Performance is a critical issue because my app will run on a smartphone. 

 

This uncertainty is due to the fact that's my first blackberry application.

 

 

 

One more time, thank you for your help. Any sugestion about libs for 7zip and rar archive manipulation will be appreciated. 

Please use plain text.
Developer
peter_strange
Posts: 19,602
Registered: ‎07-14-2008
My Device: Not Specified

Re: Searching a way to manipulate 7-zip, zip and rar archives

Just to confirm, you only want to decompress them?

 

Where will these files be located? SD Card?

Please use plain text.
New Developer
Sevottharte
Posts: 7
Registered: ‎05-09-2012
My Device: Not Specified
My Carrier: Not Specified

Re: Searching a way to manipulate 7-zip, zip and rar archives

I want see the images inside them, but if decompress them is the only way to acces these files, I'll do this.

 

These files will be located into SD card.

Please use plain text.
Contributor
goojo
Posts: 16
Registered: ‎07-28-2010
My Device: Bold 9700
My Carrier: Vodafone

Re: Searching a way to manipulate 7-zip, zip and rar archives

The 7-Zip SDK includes a pure Java implementation of the algorithm and it builds fine on the Blackberry SDK:

 

SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();	
ByteArrayInputStream	inStream = new ByteArrayInputStream(clearText, 0, clearText.length);
int propertiesSize = 5;
byte[] properties = new byte[propertiesSize];
if (inStream.read(properties, 0, propertiesSize) != propertiesSize)
	throw new Exception("input .lzma file is too short");
decoder.SetDecoderProperties(properties);
// TODO: there seems to be no sensible way to predict the output size
boolean res = decoder.Code(inStream, outStream, clearText.length*1024);

 

// John Goodyear
Please use plain text.
Developer
simon_hain
Posts: 16,102
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Searching a way to manipulate 7-zip, zip and rar archives

good to know goojo! This could be very helpful.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
peter_strange
Posts: 19,602
Registered: ‎07-14-2008
My Device: Not Specified

Re: Searching a way to manipulate 7-zip, zip and rar archives

Please use plain text.