close stream

This commit is contained in:
boy0001 2014-10-12 23:08:48 +11:00
parent 8bdbd3e628
commit 254b9d4053

View File

@ -68,13 +68,13 @@ public class SchematicHandler {
InputStream iStream = new FileInputStream(file); InputStream iStream = new FileInputStream(file);
NBTInputStream stream = new NBTInputStream(new GZIPInputStream(iStream)); NBTInputStream stream = new NBTInputStream(new GZIPInputStream(iStream));
CompoundTag tag = (CompoundTag) stream.readTag(); CompoundTag tag = (CompoundTag) stream.readTag();
stream.close();
Map<String, Tag> tagMap = tag.getValue(); Map<String, Tag> tagMap = tag.getValue();
byte[] addId = new byte[0]; byte[] addId = new byte[0];
if (tagMap.containsKey("AddBlocks")) { if (tagMap.containsKey("AddBlocks")) {
addId = ByteArrayTag.class.cast(tagMap.get("AddBlocks")).getValue(); addId = ByteArrayTag.class.cast(tagMap.get("AddBlocks")).getValue();
} }
short width = ShortTag.class.cast(tagMap.get("Width")).getValue(); short width = ShortTag.class.cast(tagMap.get("Width")).getValue();
short length = ShortTag.class.cast(tagMap.get("Length")).getValue(); short length = ShortTag.class.cast(tagMap.get("Length")).getValue();
short height = ShortTag.class.cast(tagMap.get("Height")).getValue(); short height = ShortTag.class.cast(tagMap.get("Height")).getValue();
@ -112,9 +112,7 @@ public class SchematicHandler {
e.printStackTrace(); e.printStackTrace();
return null; return null;
} }
finally { return schematic;
return schematic;
}
} }
public static class Schematic { public static class Schematic {