示例#1
0
        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());
            }
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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);
                        }
        }
示例#4
0
        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());
                        }
        }
示例#5
0
 public abstract void Write(NFX.DataAccess.Distributed.GDID value);
示例#6
0
 public static void Write(WritingStreamer streamer, ulong name, NFX.DataAccess.Distributed.GDID value)
 {
     streamer.Write(name);
     streamer.Write((byte)DataType.GDID);
     streamer.Write(value);
 }
示例#7
0
文件: SlimWriter.cs 项目: filmor/nfx
 public override void Write(NFX.DataAccess.Distributed.GDID value)
 {
     this.Write(value.Era);
     this.Write(value.ID);
 }