From 421b992b67ef80ba7cad63334d9bc53a1135e424 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 29 Aug 2016 17:58:18 +1000 Subject: [PATCH] Accidentally compressed twice --- .../java/com/sk89q/worldedit/command/ClipboardCommands.java | 5 ----- .../sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java b/core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java index a9ac5543..502ef0b8 100644 --- a/core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java +++ b/core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java @@ -61,7 +61,6 @@ import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.command.binding.Switch; import com.sk89q.worldedit.util.command.parametric.Optional; -import java.io.FileOutputStream; import java.io.IOException; import java.net.URL; import java.util.Iterator; @@ -233,10 +232,6 @@ public class ClipboardCommands { ClipboardWriter writer = format.getWriter(baos); writer.write(clipboard, null); baos.flush(); - FileOutputStream fos = new FileOutputStream("blah.png"); - fos.write(baos.toByteArray()); - fos.close(); - url = null; url = ImgurUtility.uploadImage(baos.toByteArray()); } catch (IOException e) { e.printStackTrace(); diff --git a/core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java b/core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java index 856717e8..bfc69bd3 100644 --- a/core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java +++ b/core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java @@ -69,11 +69,11 @@ public enum ClipboardFormat { @Override public ClipboardWriter getWriter(OutputStream outputStream) throws IOException { - outputStream = new BufferedOutputStream(outputStream); GZIPOutputStream gzip; if (outputStream instanceof GZIPOutputStream) { gzip = (GZIPOutputStream) outputStream; } else { + outputStream = new BufferedOutputStream(outputStream); gzip = new GZIPOutputStream(outputStream, true); } NBTOutputStream nbtStream = new NBTOutputStream(new BufferedOutputStream(gzip));