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 without saving a temp file on a device, however the only way I know of getting an InputStream for an individual entry is via ZipFile.getInputStream(entry) and since I have a ZipInputStream and not a ZipFile, that is not possible.
So the best solution I have is
- save incoming InputStream to a file
- read file as ZipFile
- use first entry’s InputStream
- delete temp file.
figured:
it’s entirely possible, the call to
ZipInputStream.getNextEntry()positions theInputStreamat the start of the entry and therefore supplying theZipInputStreamis the equivalent of supplying aZipEntry‘sInputStream.the
ZipInputStreamis smart enough to handle the entry’s EOF downstream, or so it seems.p.