wyUpdate.Common.WriteFiles.WriteInt C# (CSharp) Method

WriteInt() public static method

public static WriteInt ( Stream fs, byte flag, int num ) : void
fs Stream
flag byte
num int
return void
        public static void WriteInt(Stream fs, byte flag, int num)
        {
            //write the flag (e.g. 0x01, 0xFF, etc.)
            fs.WriteByte(flag);

            //write the size of the data (Integer = 4bytes)
            fs.Write(BitConverter.GetBytes(4), 0, 4);

            //write the integer data
            fs.Write(BitConverter.GetBytes(num), 0, 4);
        }