Move GZIPOutputStream out of NBTOutputStream.

This is a breaking change with no clear symptoms at first.
Dieser Commit ist enthalten in:
sk89q 2014-07-09 19:06:53 -07:00
Ursprung 955a52825f
Commit 7b0e5a977f
2 geänderte Dateien mit 3 neuen und 17 gelöschten Zeilen

Datei anzeigen

@ -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);
} }
/** /**

Datei anzeigen

@ -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();
} }