Skip to content

Commit 3c682e8

Browse files
authored
Restore previously removed PngFileWriter and TiffFileWriter constructors. (#585)
1 parent 5dc674d commit 3c682e8

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

chunky/src/java/se/llbit/png/PngFileWriter.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
*/
1717
package se.llbit.png;
1818

19+
import java.io.File;
20+
import java.io.FileOutputStream;
1921
import java.io.OutputStream;
2022
import se.llbit.util.TaskTracker;
2123

@@ -45,6 +47,13 @@ public PngFileWriter(OutputStream out) throws IOException {
4547
this.out.writeLong(PNG_SIGNATURE);
4648
}
4749

50+
/**
51+
* @throws IOException
52+
*/
53+
public PngFileWriter(File file) throws IOException {
54+
this(new FileOutputStream(file));
55+
}
56+
4857
/**
4958
* @throws IOException
5059
*/

chunky/src/java/se/llbit/tiff/TiffFileWriter.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
*/
1717
package se.llbit.tiff;
1818

19+
import java.io.File;
20+
import java.io.FileOutputStream;
1921
import se.llbit.chunky.renderer.scene.Scene;
2022
import se.llbit.util.TaskTracker;
2123

@@ -47,6 +49,13 @@ public TiffFileWriter(OutputStream out) throws IOException {
4749
out.write(0x2A);
4850
}
4951

52+
/**
53+
* @throws IOException
54+
*/
55+
public TiffFileWriter(File file) throws IOException {
56+
this(new FileOutputStream(file));
57+
}
58+
5059
/**
5160
* @throws IOException
5261
*/

0 commit comments

Comments
 (0)