Change-Id: I0784266814225428a6a0070d1653c465d268b342
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
public void copyCurrentContent() throws IOException {
requireLock();
try {
- final FileInputStream fis = new FileInputStream(ref);
- try {
+ try (FileInputStream fis = new FileInputStream(ref)) {
if (fsync) {
FileChannel in = fis.getChannel();
long pos = 0;
while ((r = fis.read(buf)) >= 0)
os.write(buf, 0, r);
}
- } finally {
- fis.close();
}
} catch (FileNotFoundException fnfe) {
if (ref.exists()) {