public void TestListSpeed() { ListTag list = Helpers.GenerateLongList(); using (MemoryStream ms = new MemoryStream()) { list.WriteTo(ms); ms.Position = 0; Tag.ReadFrom(ms); this.TestTagSpeed(ms, list); } }
public async Task TestListSerialization() { ListTag list = Helpers.GenerateLongList(); using (MemoryStream ms = new MemoryStream()) using (FileStream fs = File.Create(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "List.nbt"))) { list.WriteTo(ms); ms.Position = 0; await ms.CopyToAsync(fs); Console.WriteLine("Finished list serialization."); ms.Position = 0; Assert.AreEqual(list, Tag.ReadFrom <ListTag>(ms)); } }