I\'m receiving a ZipInputStream from another source, and I need to provide the first entry\'s InputStream to another source.
I was hoping to be able to do this witho
In addition to @pstanton post here is an example of code. I solved the problem using the following code. It was difficult to understand what the previous answer without an example.
//If you just want the first file in the zipped InputStream use this code.
//Otherwise loop through the InputStream using getNextEntry()
//till you find the file you want.
private InputStream convertToInputStream(InputStream stream) throws IOException {
ZipInputStream zis = new ZipInputStream(stream);
zis.getNextEntry();
return zis;
}
Using this code you can return an InputStream of the file that is zipped.