diff options
Diffstat (limited to 'src/proguard/io/ZipDataEntry.java')
-rw-r--r-- | src/proguard/io/ZipDataEntry.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/proguard/io/ZipDataEntry.java b/src/proguard/io/ZipDataEntry.java index 20a9d3b..84e24db 100644 --- a/src/proguard/io/ZipDataEntry.java +++ b/src/proguard/io/ZipDataEntry.java @@ -2,7 +2,7 @@ * ProGuard -- shrinking, optimization, obfuscation, and preverification * of Java bytecode. * - * Copyright (c) 2002-2013 Eric Lafortune (eric@graphics.cornell.edu) + * Copyright (c) 2002-2014 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 @@ -35,6 +35,7 @@ public class ZipDataEntry implements DataEntry private final DataEntry parent; private final ZipEntry zipEntry; private ZipInputStream zipInputStream; + private InputStream bufferedInputStream; public ZipDataEntry(DataEntry parent, @@ -53,12 +54,12 @@ public class ZipDataEntry implements DataEntry { // Get the right separators. String name = zipEntry.getName() - .replace(File.separatorChar, ClassConstants.INTERNAL_PACKAGE_SEPARATOR); + .replace(File.separatorChar, ClassConstants.PACKAGE_SEPARATOR); // Chop the trailing directory slash, if any. int length = name.length(); return length > 0 && - name.charAt(length-1) == ClassConstants.INTERNAL_PACKAGE_SEPARATOR ? + name.charAt(length-1) == ClassConstants.PACKAGE_SEPARATOR ? name.substring(0, length -1) : name; } @@ -72,14 +73,20 @@ public class ZipDataEntry implements DataEntry public InputStream getInputStream() throws IOException { - return zipInputStream; + if (bufferedInputStream == null) + { + bufferedInputStream = new BufferedInputStream(zipInputStream); + } + + return bufferedInputStream; } public void closeInputStream() throws IOException { zipInputStream.closeEntry(); - zipInputStream = null; + zipInputStream = null; + bufferedInputStream = null; } |