publicstaticvoid main(String[] args) throws Exception {
ZipFile zf = new ZipFile(new File(System.getProperty("test.src"), "input.jar"));
ZipEntry e = zf.getEntry("ReleaseInflater.java");
InputStream in1 = zf.getInputStream(e); // close the stream, the inflater will be released
in1.close(); // close the stream again, should be no-op
in1.close();
// create two new streams, allocating inflaters
InputStream in2 = zf.getInputStream(e);
InputStream in3 = zf.getInputStream(e);
// check to see if they influence each other if (in2.read() != in3.read()) { thrownew Exception("Stream is corrupted!");
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.