Microsoft.Protocols.TestSuites.Common.MessageReadState.Serialize C# (CSharp) Method

Serialize() public method

Serialize the ROP request buffer.
public Serialize ( ) : byte[]
return byte[]
        public byte[] Serialize()
        {
            // 0 indicates start index
            int index = 0;
            byte[] serializedBuffer = new byte[this.Size()];

            Array.Copy(BitConverter.GetBytes((ushort)this.MessageIdSize), 0, serializedBuffer, index, sizeof(ushort));
            index += sizeof(ushort);
            if (this.MessageIdSize > 0)
            {
                Array.Copy(this.MessageId, 0, serializedBuffer, index, this.MessageIdSize);
                index += this.MessageIdSize;
            }

            serializedBuffer[index++] = this.MarkAsRead;
            return serializedBuffer;
        }
MessageReadState