public void _GDID_2() { using (var ms = new MemoryStream()) { var r = SlimFormat.Instance.MakeReadingStreamer(); var w = SlimFormat.Instance.MakeWritingStreamer(); r.BindStream(ms); w.BindStream(ms); var gdid = new NFX.DataAccess.Distributed.GDID(11, 0xffffffffffffffe0); w.Write(gdid); ms.Seek(0, SeekOrigin.Begin); Assert.AreEqual(gdid, r.ReadGDID()); } }
public void NullableGDID_2() { using (var ms = new MemoryStream()) { var r = SlimFormat.Instance.MakeReadingStreamer(); var w = SlimFormat.Instance.MakeWritingStreamer(); r.BindStream(ms); w.BindStream(ms); var gdid = new NFX.DataAccess.Distributed.GDID(12, 0xffffffffffffffe0); w.Write((NFX.DataAccess.Distributed.GDID?)null); w.Write((NFX.DataAccess.Distributed.GDID?)gdid); ms.Seek(0, SeekOrigin.Begin); Assert.AreEqual(false, r.ReadNullableGDID().HasValue); Assert.AreEqual(gdid, r.ReadNullableGDID().Value); } }
public void NullableGDID_2() { using(var ms = new MemoryStream()) { var r = SlimFormat.Instance.MakeReadingStreamer(); var w = SlimFormat.Instance.MakeWritingStreamer(); r.BindStream(ms); w.BindStream(ms); var gdid = new NFX.DataAccess.Distributed.GDID(12, 0xffffffffffffffe0); w.Write((NFX.DataAccess.Distributed.GDID?)null); w.Write((NFX.DataAccess.Distributed.GDID?)gdid); ms.Seek(0, SeekOrigin.Begin); Assert.AreEqual(false, r.ReadNullableGDID().HasValue); Assert.AreEqual(gdid, r.ReadNullableGDID().Value); } }
public void _GDID_2() { using(var ms = new MemoryStream()) { var r = SlimFormat.Instance.MakeReadingStreamer(); var w = SlimFormat.Instance.MakeWritingStreamer(); r.BindStream(ms); w.BindStream(ms); var gdid = new NFX.DataAccess.Distributed.GDID(11, 0xffffffffffffffe0); w.Write(gdid); ms.Seek(0, SeekOrigin.Begin); Assert.AreEqual(gdid, r.ReadGDID()); } }
public abstract void Write(NFX.DataAccess.Distributed.GDID value);
public static void Write(WritingStreamer streamer, ulong name, NFX.DataAccess.Distributed.GDID value) { streamer.Write(name); streamer.Write((byte)DataType.GDID); streamer.Write(value); }
public override void Write(NFX.DataAccess.Distributed.GDID value) { this.Write(value.Era); this.Write(value.ID); }