diff options
Diffstat (limited to 'src/proguard/io/DataEntryCopier.java')
-rw-r--r-- | src/proguard/io/DataEntryCopier.java | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/proguard/io/DataEntryCopier.java b/src/proguard/io/DataEntryCopier.java index faaa555..440e73b 100644 --- a/src/proguard/io/DataEntryCopier.java +++ b/src/proguard/io/DataEntryCopier.java @@ -2,7 +2,7 @@ * ProGuard -- shrinking, optimization, obfuscation, and preverification * of Java bytecode. * - * Copyright (c) 2002-2009 Eric Lafortune (eric@graphics.cornell.edu) + * Copyright (c) 2002-2013 Eric Lafortune (eric@graphics.cornell.edu) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -64,11 +64,16 @@ public class DataEntryCopier implements DataEntryReader { InputStream inputStream = dataEntry.getInputStream(); - // Copy the data from the input entry to the output entry. - copyData(inputStream, outputStream); - - // Close the data entries. - dataEntry.closeInputStream(); + try + { + // Copy the data from the input entry to the output entry. + copyData(inputStream, outputStream); + } + finally + { + // Close the data entries. + dataEntry.closeInputStream(); + } } } } @@ -76,6 +81,10 @@ public class DataEntryCopier implements DataEntryReader { System.err.println("Warning: can't write resource [" + dataEntry.getName() + "] (" + ex.getMessage() + ")"); } + catch (Exception ex) + { + throw (IOException)new IOException("Can't write resource ["+dataEntry.getName()+"] ("+ex.getMessage()+")").initCause(ex); + } } |