This is how I did it. Once you finish downloading the zip fie from a url and you get a byte[] array out of it, simply pass it to a ByteArrayInputStream and pass that input stream to a ZipInputStream.

Check out the code:

In a zip file, every file or folder is represented by a ZipEntry. To browse through the zip file’s contents, loop the ZipInputStream and call getNextEntry() which returns a ZipEntry object.

To get the input stream of the file, just use the same ZipInputStream object. The developers did a slick job of designing this class.

Check out the code:

What the code does is that when getNextEntry() is called, it will go to the first file (or folder) in the list. The code assumes that there is only one file in the zip file and it reads the content of the file without having to save it.

You have to add code such as doing a check if the ZipEntry is a file or folder in case you have different file types in your zip file.

This is a Sponsored post written by me on behalf of MyReviewsNow.net for SocialSpark. All opinions are 100% mine.

Even with all the influx of online shopping portals popping up here and there, I still have second thoughts when buying something online. Considering that some portals sell them so cheap, my doubts even grow stronger and I get apprehensive if the site itself is legit or not.

But sites like myreviewsnow.net have changed my perception. Having online shopping resources in one place is very advantageous because I do not have to go to each site to check out their prices and compare them. Doing the comparison in just one site saves me a lot of time.

Plus reviews help give ideas on what the product really is like in actual action. You say they may be biased but no, the reviews also come from on hand experience with customers who used the product. This is a good starting point to know if the product you plan to buy is worth it or not.

I recommend you check out the site to get started. Even better is the fact that right now, they are giving away a $340 Kohl’s gift card by simply liking their Facebook page and tweeting the message “I love to #shopathome online!”.

Check out the official rules here.

Visit Sponsor's Site

Related Posts Plugin for WordPress, Blogger...