fix ordering of BufferedOutputStream; huge speed fix

This commit is contained in:
Ben Fry
2017-02-20 15:30:49 -05:00
parent f3f5583e9b
commit d0707b5fd6
+3 -4
View File
@@ -7384,12 +7384,11 @@ public class PApplet implements PConstants {
static public OutputStream createOutput(File file) {
try {
createPath(file); // make sure the path exists
OutputStream output =
new BufferedOutputStream(new FileOutputStream(file));
OutputStream output = new FileOutputStream(file);
if (file.getName().toLowerCase().endsWith(".gz")) {
return new GZIPOutputStream(output);
return new BufferedOutputStream(new GZIPOutputStream(output));
}
return output;
return new BufferedOutputStream(output);
} catch (IOException e) {
e.printStackTrace();