Exemplo n.º 1
0
        public void GetHeaderDataToStream(Stream stream)
        {
            if (Body != null)
            {
                Header.Length = (uint)Body.Length;
            }

            MessageWriter writer = new MessageWriter(Header.Endianness);

            //headerWriter (writer, Header);

            writer.Write((byte)Header.Endianness);
            writer.Write((byte)Header.MessageType);
            writer.Write((byte)Header.Flags);
            writer.Write(Header.MajorVersion);
            writer.Write(Header.Length);
            writer.Write(Header.Serial);
            writer.WriteHeaderFields(Header.Fields);

            writer.CloseWrite();

            writer.ToStream(stream);
        }
Exemplo n.º 2
0
        public void GetHeaderDataToStream(Stream stream)
        {
            if (Body != null)
                Header.Length = (uint)Body.Length;

            MessageWriter writer = new MessageWriter (Header.Endianness);

            //headerWriter (writer, Header);

            writer.Write ((byte)Header.Endianness);
            writer.Write ((byte)Header.MessageType);
            writer.Write ((byte)Header.Flags);
            writer.Write (Header.MajorVersion);
            writer.Write (Header.Length);
            writer.Write (Header.Serial);
            writer.WriteHeaderFields (Header.Fields);

            writer.CloseWrite ();

            writer.ToStream (stream);
        }