コード例 #1
0
        public byte[] WriteSetToByte(WriteSetLCS source)
        {
            var result = U32ToByte((uint)source.WriteSet.Count);

            foreach (var writeSet in source.WriteSet)
            {
                var key = LCSCore.LCSDeserialization(writeSet.Key);
                result = result.Concat(key).ToArray();
                var ops = LCSCore.LCSDeserialization(writeSet.Value);
                result = result.Concat(ops).ToArray();
            }

            return(result);
        }
コード例 #2
0
        public WriteSetLCS GetWriteSet(byte[] source, ref int cursor)
        {
            var retVal = new WriteSetLCS();

            retVal.WriteSet = new Dictionary <AccessPathLCS, WriteOpLCS>();
            retVal.Length   = Read_u32(source, ref cursor);

            for (int i = 0; i < retVal.Length; i++)
            {
                var key   = source.LCSerialization <AccessPathLCS>(ref cursor);
                var value = source.LCSerialization <WriteOpLCS>(ref cursor);

                retVal.WriteSet.Add(key, value);
            }
            return(retVal);
        }