Here you can find the source of readEntryAsWhatEverInternal( final ZipEntry entry, final InputStream unzippedInputStream)
private static InputStream readEntryAsWhatEverInternal( final ZipEntry entry, final InputStream unzippedInputStream) throws IOException
//package com.java2s; /*/*from w ww . j av a 2 s. co m*/ * ZipUtils.java: First version written on 16. Feb. 2011. * * This file is subject to the terms and conditions defined in * file 'licence.txt', which is part of this source code package. */ import java.io.IOException; import java.io.InputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; public class Main { private static InputStream readEntryAsWhatEverInternal( final ZipEntry entry, final InputStream unzippedInputStream) throws IOException { InputStream is = null; ZipInputStream zipIs = null; zipIs = new ZipInputStream(unzippedInputStream); ZipEntry ze; while ((ze = zipIs.getNextEntry()) != null) { if (ze.getName().equals(entry.getName())) { is = zipIs; break; } } if (null == is) { throw new IOException("Cannot find the given entry " + entry + " in ZIP file provided"); } return is; } }