I am trying to read a Zip archive with a ZipInputStream
. I cycle through all the entries without any problem like so:
try {
while((ze = zis.getNextEntry()) != null) {
Log.v(this.toString(), "Name = " + name);
}
} catch (IOException e) {
// TODO Auto-generated catch block
//e.printStackTrace();
Log.e(this.toString(), "IOException in creating ZipEntry.");
}
When I try to use the zis
variable to read the same zip file in another function, in the same manner as described above, line ze = zis.getNextEntry()
returns null
. This is understandable because the end of the stream has been reached.
My question(s):
1. How do I "rewind" a stream?
2. Is there an alternate to creating a temporary ZipInputStream
and using that in the next function where I am required to read the zip file again?