Ejemplo n.º 1
0
            static public byte[] Obj2Bytes <T>(T obj) where T : IMarshallable
            {
                var dst    = new MemoryStream();
                var writer = new MsgPackDataWriter(dst);

                Sync(SyncContext.NewWriter(writer), ref obj);
                return(dst.GetBuffer());
            }
Ejemplo n.º 2
0
            static public void Obj2Stream <T>(T obj, Stream dst) where T : IMarshallable
            {
                var writer = new MsgPackDataWriter(dst);

                Sync(SyncContext.NewWriter(writer), ref obj);
            }