public async Task ReadUInt32_Async() { using (var f = new GenericFile()) { f.CreateFile(new byte[] { 42, 00, 00, 00, 255, 255, 255, 255 }); Assert.AreEqual((UInt32)42, await f.ReadUInt32Async(0)); Assert.AreEqual(UInt32.MaxValue, await f.ReadUInt32Async(4)); } }
/// <summary> /// Determines whether or not the given file is a save file for Pokémon Mystery Dungeon: Explorers of Time and Darkness. /// </summary> /// <param name="file">The file to be checked</param> /// <returns>A boolean indicating whether or not the given file is supported by this class</returns> public virtual async Task <bool> IsOfType(GenericFile file) { if (file.Length > Offsets.ChecksumEnd) { return(await file.ReadUInt32Async(0) == Checksums.Calculate32BitChecksum(file, 4, Offsets.ChecksumEnd)); } else { return(false); } }