CloseWrite() public method

public CloseWrite ( ) : void
return void
Esempio n. 1
0
		public byte[] GetHeaderData ()
		{
			if (Body != null)
				Header.Length = (uint)Body.Length;

			MessageWriter writer = new MessageWriter (Header.Endianness);
			writer.WriteValueType (Header, typeof (Header));
			writer.CloseWrite ();

			return writer.ToArray ();
		}
Esempio n. 2
0
        public byte[] GetHeaderData()
        {
            if (Body != null)
            {
                Header.Length = (uint)Body.Length;
            }

            MessageWriter writer = new MessageWriter(Header.Endianness);

            writer.WriteValueType(Header, typeof(Header));
            writer.CloseWrite();

            return(writer.ToArray());
        }
        public void WriteHeader()
        {
            if (Body != null)
            {
                Header.Length = (uint)Body.Length;
            }

            MessageWriter writer = new MessageWriter(Connection.NativeEndianness);

            writer.WriteStruct(typeof(Header), Header);
            //writer.WriteFromDict (typeof (FieldCode), typeof (object), Header.Fields);
            writer.CloseWrite();
            HeaderData = writer.ToArray();
        }
Esempio n. 4
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);
        }
Esempio n. 5
0
        //public HeaderField[] Fields;

        /*
         * public void SetHeaderData (byte[] data)
         * {
         *      EndianFlag endianness = (EndianFlag)data[0];
         *      MessageReader reader = new MessageReader (endianness, data);
         *
         *      Header = (Header)reader.ReadStruct (typeof (Header));
         * }
         */

        //TypeWriter<Header> headerWriter = TypeImplementer.GetTypeWriter<Header> ();
        public byte[] GetHeaderData()
        {
            if (Body != null)
            {
                Header.Length = (uint)Body.Length;
            }

            MessageWriter writer = new MessageWriter(Header.Endianness);

            //writer.stream.Capacity = 512;
            //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();

            return(writer.ToArray());
        }
Esempio n. 6
0
		public void WriteHeader ()
		{
			if (Body != null)
				Header.Length = (uint)Body.Length;

			MessageWriter writer = new MessageWriter (Connection.NativeEndianness);
			writer.WriteStruct (typeof (Header), Header);
			//writer.WriteFromDict (typeof (FieldCode), typeof (object), Header.Fields);
			writer.CloseWrite ();
			HeaderData = writer.ToArray ();
		}
        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);
        }
        //public HeaderField[] Fields;
        /*
        public void SetHeaderData (byte[] data)
        {
            EndianFlag endianness = (EndianFlag)data[0];
            MessageReader reader = new MessageReader (endianness, data);

            Header = (Header)reader.ReadStruct (typeof (Header));
        }
        */
        //TypeWriter<Header> headerWriter = TypeImplementer.GetTypeWriter<Header> ();
        public byte[] GetHeaderData()
        {
            if (Body != null)
                Header.Length = (uint)Body.Length;

            MessageWriter writer = new MessageWriter (Header.Endianness);

            //writer.stream.Capacity = 512;
            //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 ();

            return writer.ToArray ();
        }