Ejemplo n.º 1
0
        public uint Serialize(byte[] buff, uint offset, uint buffLen)
        {
            uint buffPos = offset;
            uint copyLen = 0;

            copyLen  = ss.Serialize(buff, buffPos, buffLen - (buffPos - offset));
            buffPos += copyLen;

            copyLen = 2;
            SerializeUtil.LEMemcpy(buff, buffPos, BitConverter.GetBytes((ushort)name.Count), 0, copyLen);
            buffPos += copyLen;

            if (name.Count > 1000)
            {
                return(0);
            }
            if (name.Count > 0)
            {
                for (int i = 0; i < name.Count; ++i)
                {
                    buff[buffPos + i] = name[i];
                }
                buffPos += (uint)name.Count;
            }

            return(buffPos - offset);
        }
Ejemplo n.º 2
0
        public uint Serialize(byte[] buff, uint offset, uint buffLen)
        {
            uint buffPos = offset;
            uint copyLen = 0;

            copyLen  = ss.Serialize(buff, buffPos, buffLen - (buffPos - offset));
            buffPos += copyLen;

            return(buffPos - offset);
        }
Ejemplo n.º 3
0
        public uint Serialize(byte[] buff, uint offset, uint buffLen)
        {
            uint buffPos = offset;
            uint copyLen = 0;

            copyLen = 2;
            SerializeUtil.LEMemcpy(buff, buffPos, BitConverter.GetBytes((ushort)list.Count), 0, copyLen);
            buffPos += copyLen;

            if (list.Count > 1000)
            {
                return(0);
            }
            if (list.Count > 0)
            {
                for (int i = 0; i < list.Count; ++i)
                {
                    copyLen  = list[i].Serialize(buff, buffPos, buffLen - (buffPos - offset));
                    buffPos += copyLen;
                }
            }

            copyLen  = stru.Serialize(buff, buffPos, buffLen - (buffPos - offset));
            buffPos += copyLen;

            copyLen = 2;
            SerializeUtil.LEMemcpy(buff, buffPos, BitConverter.GetBytes((ushort)numList.Count), 0, copyLen);
            buffPos += copyLen;

            if (numList.Count > 1000)
            {
                return(0);
            }
            if (numList.Count > 0)
            {
                copyLen = sizeof(int);
                for (int i = 0; i < numList.Count; ++i)
                {
                    SerializeUtil.LEMemcpy(buff, buffPos, BitConverter.GetBytes(numList[i]), 0, copyLen);
                    buffPos += copyLen;
                }
            }

            return(buffPos - offset);
        }