I am trying to write code that decompresses a zip archive and puts the output in another folder.
Do I need to use a third-party library? Does anyone have a code to get me started?
ZipEntry dataZE;
InputStream isData = getClass().getResourceAsStream("/" + dataName + ".zip");
StringBuffer sbData = new StringBuffer();
ZipInputStream dataZIS = new ZipInputStream(isData);
FileConnection file =
(FileConnection)Connector.open(
"file:///SDCard/BlackBerry/documents/" + filename,
Connector.READ_WRITE
);
if (!file.exists()) {
file.mkdir();
}
while ((dataZE = dataZIS.getNextEntry()) != null) {
out.write(dataZE );
out.flash();
dataZIS.closeEntry();
}
source
share