Example #1
0
        /// <summary>
        /// Converts member data to byte[]
        /// </summary>
        /// <param name="buffer"></param>
        public void WriteDataToBuffer(BufferChunk buffer)
        {
            // "Clear" the byte by setting the Version
            // 2 (10) becomes 128 (10000000) when you shift it into place in the header
            buffer[0] = Rtp.VERSION << 6;

            // Padding
            if(Padding == true)
            {
                buffer[0] |= PADDING_MASK;
            }

            // ItemCount
            buffer[0] += (byte)(ItemCount); // Add in the new value

            // PacketType
            buffer[1] = PacketType;

            // Length
            buffer.SetInt16(2, Length);
        }