Accidentally compressed twice

This commit is contained in:
Jesse Boyd 2016-08-29 17:58:18 +10:00
parent 36a1e9f744
commit 421b992b67
2 changed files with 1 additions and 6 deletions

View File

@ -61,7 +61,6 @@ import com.sk89q.worldedit.session.ClipboardHolder;
import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.util.command.binding.Switch; import com.sk89q.worldedit.util.command.binding.Switch;
import com.sk89q.worldedit.util.command.parametric.Optional; import com.sk89q.worldedit.util.command.parametric.Optional;
import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.util.Iterator; import java.util.Iterator;
@ -233,10 +232,6 @@ public class ClipboardCommands {
ClipboardWriter writer = format.getWriter(baos); ClipboardWriter writer = format.getWriter(baos);
writer.write(clipboard, null); writer.write(clipboard, null);
baos.flush(); baos.flush();
FileOutputStream fos = new FileOutputStream("blah.png");
fos.write(baos.toByteArray());
fos.close();
url = null;
url = ImgurUtility.uploadImage(baos.toByteArray()); url = ImgurUtility.uploadImage(baos.toByteArray());
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -69,11 +69,11 @@ public enum ClipboardFormat {
@Override @Override
public ClipboardWriter getWriter(OutputStream outputStream) throws IOException { public ClipboardWriter getWriter(OutputStream outputStream) throws IOException {
outputStream = new BufferedOutputStream(outputStream);
GZIPOutputStream gzip; GZIPOutputStream gzip;
if (outputStream instanceof GZIPOutputStream) { if (outputStream instanceof GZIPOutputStream) {
gzip = (GZIPOutputStream) outputStream; gzip = (GZIPOutputStream) outputStream;
} else { } else {
outputStream = new BufferedOutputStream(outputStream);
gzip = new GZIPOutputStream(outputStream, true); gzip = new GZIPOutputStream(outputStream, true);
} }
NBTOutputStream nbtStream = new NBTOutputStream(new BufferedOutputStream(gzip)); NBTOutputStream nbtStream = new NBTOutputStream(new BufferedOutputStream(gzip));