src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java
Print this page
rev 3516 : 7021582: convert jar/zip code and tests to use try-with-resources
Reviewed-by: XXX
*** 239,251 ****
}
void run(File inFile, JarOutputStream jstream) throws IOException {
// %%% maybe memory-map the file, and pass it straight into unpacker
ByteBuffer mappedFile = null;
! FileInputStream fis = new FileInputStream(inFile);
run(fis, jstream, mappedFile);
! fis.close();
// Note: caller is responsible to finish with jstream.
}
private void writeEntry(JarOutputStream j, String name,
long mtime, long lsize, boolean deflateHint,
--- 239,251 ----
}
void run(File inFile, JarOutputStream jstream) throws IOException {
// %%% maybe memory-map the file, and pass it straight into unpacker
ByteBuffer mappedFile = null;
! try (FileInputStream fis = new FileInputStream(inFile)) {
run(fis, jstream, mappedFile);
! }
// Note: caller is responsible to finish with jstream.
}
private void writeEntry(JarOutputStream j, String name,
long mtime, long lsize, boolean deflateHint,