开发者

How to read file from ZIP archive

I am facing a problem where i need to convery the zipentry into a file.

What happens is that I have a zip file full of csv files. I need to unzip the file and extract out the csv files 开发者_StackOverflow社区and read it using a Scanner() which takes in only a file (type) and not a zipentry...


Scanner class also accepts InputStream in one of its constructors. Once you have ZipEntry (you obtain it from ZipFile), you can use it in myZipFile.getInputStream(zipEntry) method to get InputStream that you can pass to Scanner.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜