Move GZIPOutputStream out of NBTOutputStream.

This is a breaking change with no clear symptoms at first.
This commit is contained in:
sk89q 2014-07-09 19:06:53 -07:00
parent 955a52825f
commit 7b0e5a977f
2 changed files with 3 additions and 17 deletions

View File

@ -24,21 +24,6 @@ import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.List; import java.util.List;
import java.util.zip.GZIPOutputStream;
import com.sk89q.jnbt.ByteArrayTag;
import com.sk89q.jnbt.ByteTag;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.DoubleTag;
import com.sk89q.jnbt.EndTag;
import com.sk89q.jnbt.FloatTag;
import com.sk89q.jnbt.IntTag;
import com.sk89q.jnbt.ListTag;
import com.sk89q.jnbt.LongTag;
import com.sk89q.jnbt.NBTConstants;
import com.sk89q.jnbt.NBTUtils;
import com.sk89q.jnbt.ShortTag;
import com.sk89q.jnbt.StringTag;
import com.sk89q.jnbt.Tag;
/** /**
* <p> * <p>
@ -72,7 +57,7 @@ public final class NBTOutputStream implements Closeable {
* if an I/O error occurs. * if an I/O error occurs.
*/ */
public NBTOutputStream(OutputStream os) throws IOException { public NBTOutputStream(OutputStream os) throws IOException {
this.os = new DataOutputStream(new GZIPOutputStream(os)); this.os = new DataOutputStream(os);
} }
/** /**

View File

@ -34,6 +34,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.zip.GZIPInputStream; import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
/** /**
* @author zml2008 * @author zml2008
@ -278,7 +279,7 @@ public class MCEditSchematicFormat extends SchematicFormat {
// Build and output // Build and output
CompoundTag schematicTag = new CompoundTag("Schematic", schematic); CompoundTag schematicTag = new CompoundTag("Schematic", schematic);
NBTOutputStream stream = new NBTOutputStream(new FileOutputStream(file)); NBTOutputStream stream = new NBTOutputStream(new GZIPOutputStream(new FileOutputStream(file)));
stream.writeTag(schematicTag); stream.writeTag(schematicTag);
stream.close(); stream.close();
} }