mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-01 06:44:51 +00:00
always use buffered output streams when writing to a file, faster swf xml export by caching the fields
This commit is contained in:
@@ -30,6 +30,7 @@ import java.awt.Shape;
|
||||
import java.awt.geom.Area;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.DataBufferInt;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
@@ -843,9 +844,9 @@ public class Helper {
|
||||
}
|
||||
|
||||
public static void saveStream(InputStream is, File output) throws IOException {
|
||||
byte[] buf = new byte[1024];
|
||||
byte[] buf = new byte[4096];
|
||||
int cnt;
|
||||
try (FileOutputStream fos = new FileOutputStream(output)) {
|
||||
try (OutputStream fos = new BufferedOutputStream(new FileOutputStream(output))) {
|
||||
while ((cnt = is.read(buf)) > 0) {
|
||||
fos.write(buf, 0, cnt);
|
||||
fos.flush();
|
||||
|
||||
Reference in New Issue
Block a user