File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -6920,18 +6920,19 @@ static public PrintWriter createWriter(OutputStream output) {
69206920 *
69216921 */
69226922 public InputStream createInput(String filename) {
6923- InputStream input = new BufferedInputStream( createInputRaw(filename) );
6923+ InputStream input = createInputRaw(filename);
69246924 final String lower = filename.toLowerCase();
69256925 if ((input != null) &&
69266926 (lower.endsWith(".gz") || lower.endsWith(".svgz"))) {
69276927 try {
6928- return new GZIPInputStream(input);
6928+ // buffered has to go *around* the GZ, otherwise 25x slower
6929+ return new BufferedInputStream(new GZIPInputStream(input));
69296930 } catch (IOException e) {
69306931 printStackTrace(e);
69316932 return null;
69326933 }
69336934 }
6934- return input;
6935+ return new BufferedInputStream( input) ;
69356936 }
69366937
69376938
@@ -7103,11 +7104,11 @@ static public InputStream createInput(File file) {
71037104 throw new IllegalArgumentException("File passed to createInput() was null");
71047105 }
71057106 try {
7106- InputStream input = new BufferedInputStream(new FileInputStream(file) );
7107+ InputStream input = new FileInputStream(file);
71077108 if (file.getName().toLowerCase().endsWith(".gz")) {
7108- return new GZIPInputStream(input);
7109+ return new BufferedInputStream(new GZIPInputStream(input) );
71097110 }
7110- return input;
7111+ return new BufferedInputStream( input) ;
71117112
71127113 } catch (IOException e) {
71137114 System.err.println("Could not createInput() for " + file);
You can’t perform that action at this time.
0 commit comments