Ejemplo n.º 1
0
        /// <inheritdoc/>
        public Byte[] Encode(Response response)
        {
            DatagramWriter writer = new DatagramWriter();

            Serialize(writer, response, response.Code);
            return(writer.ToByteArray());
        }
Ejemplo n.º 2
0
        /// <inheritdoc/>
        public Byte[] Encode(EmptyMessage message)
        {
            DatagramWriter writer = new DatagramWriter();

            Serialize(writer, message, Code.Empty);
            return(writer.ToByteArray());
        }
Ejemplo n.º 3
0
        /// <inheritdoc/>
        public Byte[] Encode(Request request)
        {
            DatagramWriter writer = new DatagramWriter();

            Serialize(writer, request, request.Code);
            return(writer.ToByteArray());
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Serializes a message.
 /// </summary>
 /// <param name="writer">the writer</param>
 /// <param name="message">the message to write</param>
 /// <param name="code">the code</param>
 protected abstract void Serialize(DatagramWriter writer, Message message, Int32 code);