public bool Claims(string fileName) { try { using (FileStream mapStream = File.OpenRead(fileName)) { GZipStream gs = new GZipStream(mapStream, CompressionMode.Decompress, true); BinaryReader bs = new BinaryReader(gs); return(bs.ReadByte() == 10 && NBTag.ReadString(bs) == "MinecraftLevel"); } } catch (Exception) { return(false); } }
public bool Claims(string fileName) { if (fileName == null) { throw new ArgumentNullException("fileName"); } try { using (FileStream mapStream = File.OpenRead(fileName)) { GZipStream gs = new GZipStream(mapStream, CompressionMode.Decompress, true); BinaryReader bs = new BinaryReader(gs); return(bs.ReadByte() == 10 && NBTag.ReadString(bs) == "ClassicWorld"); } } catch (Exception) { return(false); } }