I'm trying to unzip a zip folder, I have problem understand how the ZipInputStream.read(byte[])
work. This code work just fine but I don't know if my file is bigger than the buffer I set how I'll operate.
byte[] buffer = new byte[1024];
zipIs = new ZipInputStream(new FileInputStream(FILE_PATH));
while ((entry = zipIs.getNextEntry()) != null) {
String entryName = File.separator + entry.getName();
// Call file input stream
FileOutputStream fos = new FileOutputStream(entryName);
int len;
// Write current entry
while ((len = zipIs.read(buffer)) > 0) {
fos.write(buffer, 0, len);
}
fos.close();
}
I did read the doc but I find it confusing, please help.