File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6920,7 +6920,7 @@ static public PrintWriter createWriter(OutputStream output) {
69206920 *
69216921 */
69226922 public InputStream createInput(String filename) {
6923- InputStream input = createInputRaw(filename);
6923+ InputStream input = new BufferedInputStream( createInputRaw(filename) );
69246924 final String lower = filename.toLowerCase();
69256925 if ((input != null) &&
69266926 (lower.endsWith(".gz") || lower.endsWith(".svgz"))) {
@@ -7360,11 +7360,12 @@ public OutputStream createOutput(String filename) {
73607360 static public OutputStream createOutput(File file) {
73617361 try {
73627362 createPath(file); // make sure the path exists
7363- FileOutputStream fos = new FileOutputStream(file);
7363+ OutputStream output =
7364+ new BufferedOutputStream(new FileOutputStream(file));
73647365 if (file.getName().toLowerCase().endsWith(".gz")) {
7365- return new GZIPOutputStream(fos );
7366+ return new GZIPOutputStream(output );
73667367 }
7367- return fos ;
7368+ return output ;
73687369
73697370 } catch (IOException e) {
73707371 e.printStackTrace();
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ X add sum() to IntDict and FloatDict
44X add sumLong() to IntList, IntDict (to handle cases outside integer range)
55X add sumDouble() to FloatList, FloatDict (to handle outside float range)
66X throw exception when using sum() with numbers that are too large or small
7+ X createInput() and createOutput() now both use buffered streams by default
8+ X createInputRaw() does not, however
79
810
911gohai
You can’t perform that action at this time.
0 commit comments