import jp.hishidama.zip.ZipCloak; import jp.hishidama.zip.ZipEntry; import jp.hishidama.zip.ZipFile; //import java.io.File; import java.nio.charset.Charset; import java.io.UnsupportedEncodingException; import java.util.*; import java.io.*; class ZipTest { static int begin = ' '; static int end = '~'; public static void main(String[] args) throws Exception { ZipFile zf = new ZipFile(new File(args[1])); String passwd = args[0]; try { zf.setPassword(passwd.getBytes("ASCII")); zf.setCheckCrc(true); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } for(Iterator i = zf.getEntriesIterator(); i.hasNext();) { ZipEntry ze = i.next(); InputStream is = zf.getInputStream(ze); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for(;;) { int c = is.read(); if (c == -1) break; bos.write(c); } is.close(); System.out.println(bos.size()); } zf.close(); } }