How to read multiple ZipEntry using single InputStream?
I have to get a InputStream for a file from a File Server and hand that InputStream over to another server which process the InputStream.
My problem is, some of the files are Zip files with multiple ZipEntry in them. I can do like ZipInputStream zip = new ZipInputStream(inputStream); and then do zip.getNextEntry() for each entry and read. But, my receiving server expect a single inputStream and I have to provide all zip entries in a single stream.
Please let me know what to do or how to do. I cannot use ZipFile since the file is not in the same machine. I also cannot read and keep the whole file in a String or ByteArrayOutputStream as the contents of the files can be very big and it will fill up the memory.
Is it possible to overload(extend) ZipInputStream in such a way that read() gives a single inputStream combining all the zip entries inside ? If so, please let me know how to do that.
Thanks in advance,