Skip to content

Commit bc2cfcd

Browse files
committed
ported fix ordering of BufferedOutputStream
1 parent 63c698a commit bc2cfcd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

core/src/processing/core/PApplet.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5086,11 +5086,12 @@ public OutputStream createOutput(String filename) {
50865086

50875087
static public OutputStream createOutput(File file) {
50885088
try {
5089-
FileOutputStream fos = new FileOutputStream(file);
5089+
createPath(file); // make sure the path exists
5090+
OutputStream output = new FileOutputStream(file);
50905091
if (file.getName().toLowerCase().endsWith(".gz")) {
5091-
return new GZIPOutputStream(fos);
5092+
return new BufferedOutputStream(new GZIPOutputStream(output));
50925093
}
5093-
return fos;
5094+
return new BufferedOutputStream(output);
50945095

50955096
} catch (IOException e) {
50965097
e.printStackTrace();

0 commit comments

Comments
 (0)