int z = Integer.parseInt(m.group(2));
ChunkData data = Region.getChunkData(new File(filename),
ChunkPosition.get(x, z));
if (data == null) {
System.err.println("No such chunk in region: (" + x + "," + z + ")");
return new ErrorTag();
}
in = data.inputStream;
} else {
filename = arg;
InputStream is = new BufferedInputStream(
new FileInputStream(new File(filename)));
if (isGzipped(is)) {
is = new GZIPInputStream(is);
}
in = new DataInputStream(is);
}
if (in != null) {
return NamedTag.read(in);
} else {
System.err.println("Failed to open file: " + filename);
return new ErrorTag();
}
} finally {
if (in != null) in.close();
}
}