File zipdir = new File("e:/test.zip");
Charset gbk = Charset.forName("GBK");
ZipInputStream zin = null;
try {
ZipFile zf = new ZipFile(zipdir, gbk);
InputStream inZip = new BufferedInputStream(new FileInputStream(zipdir));
zin = new ZipInputStream(inZip);
ZipEntry ze;
InputStream inputStream;
while ((ze = zin.getNextEntry()) != null) {
if (ze.isDirectory()) {
continue;
} else {
long size = ze.getSize();
inputStream = zf.getInputStream(ze);
int length = ze.getName().split("/").length;
imgMap.put(ze.getName().split("/")[length - 1], inputStream);
}
}
} catch (Exception e1) {
e1.printStackTrace();
} finally {
if (zin != null) {
zin.closeEntry();
}
}