| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6920,18 +6920,19 @@ static public PrintWriter createWriter(OutputStream output) { | |||
| 6920 | 6920 | * | |
| 6921 | 6921 | */ | |
| 6922 | 6922 | public InputStream createInput(String filename) { | |
| 6923 | - InputStream input = new BufferedInputStream(createInputRaw(filename)); | ||
| 6923 | + InputStream input = createInputRaw(filename); | ||
| 6924 | 6924 | final String lower = filename.toLowerCase(); | |
| 6925 | 6925 | if ((input != null) && | |
| 6926 | 6926 | (lower.endsWith(".gz") || lower.endsWith(".svgz"))) { | |
| 6927 | 6927 | try { | |
| 6928 | - return new GZIPInputStream(input); | ||
| 6928 | + // buffered has to go *around* the GZ, otherwise 25x slower | ||
| 6929 | + return new BufferedInputStream(new GZIPInputStream(input)); | ||
| 6929 | 6930 | } catch (IOException e) { | |
| 6930 | 6931 | printStackTrace(e); | |
| 6931 | 6932 | return null; | |
| 6932 | 6933 | } | |
| 6933 | 6934 | } | |
| 6934 | - return input; | ||
| 6935 | + return new BufferedInputStream(input); | ||
| 6935 | 6936 | } | |
| 6936 | 6937 | ||
| 6937 | 6938 | ||
@@ -7103,11 +7104,11 @@ static public InputStream createInput(File file) { | |||
| 7103 | 7104 | throw new IllegalArgumentException("File passed to createInput() was null"); | |
| 7104 | 7105 | } | |
| 7105 | 7106 | try { | |
| 7106 | - InputStream input = new BufferedInputStream(new FileInputStream(file)); | ||
| 7107 | + InputStream input = new FileInputStream(file); | ||
| 7107 | 7108 | if (file.getName().toLowerCase().endsWith(".gz")) { | |
| 7108 | - return new GZIPInputStream(input); | ||
| 7109 | + return new BufferedInputStream(new GZIPInputStream(input)); | ||
| 7109 | 7110 | } | |
| 7110 | - return input; | ||
| 7111 | + return new BufferedInputStream(input); | ||
| 7111 | 7112 | ||
| 7112 | 7113 | } catch (IOException e) { | |
| 7113 | 7114 | System.err.println("Could not createInput() for " + file); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments