Example #1
0
            public override int Deserialize(System.Byte[] serialized, int startIndex)
            {
                int curIndex = startIndex;

                curIndex += layout.Deserialize(serialized, curIndex);
                System.UInt32 data_len = BitConverter.ToUInt32(serialized, curIndex);
                curIndex += BitConverter.GetBytes(data_len).Length;
                System.Byte[] temp = new System.Byte[data_len];
                Array.Copy(serialized, curIndex, temp, 0, data_len);
                data      = temp.ToList();
                curIndex += (int)data_len;
                return(curIndex - startIndex);
            }
            public override int Deserialize(System.Byte[] serialized, int startIndex)
            {
                int curIndex = startIndex;

                curIndex += layout.Deserialize(serialized, curIndex);
                System.UInt32 data_len = BitConverter.ToUInt32(serialized, curIndex);
                curIndex += BitConverter.GetBytes(data_len).Length;
                for (int i = 0; i < (int)data_len; i++)
                {
                    System.Int32 element = BitConverter.ToInt32(serialized, curIndex);
                    curIndex += BitConverter.GetBytes(element).Length;
                    data.Add(element);
                }
                return(curIndex - startIndex);
            }