WriteVariableUInt32() public method

Write Base128 encoded variable sized unsigned integer of up to 32 bits
public WriteVariableUInt32 ( uint value ) : int
value uint
return int
Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new message for sending and writes the provided string to it
        /// </summary>
        public NetOutgoingMessage CreateMessage(string content)
        {
            byte[]             bytes = Encoding.UTF8.GetBytes(content);
            NetOutgoingMessage om    = CreateMessage(2 + bytes.Length);

            om.WriteVariableUInt32((uint)bytes.Length);
            om.Write(bytes);
            return(om);
        }