using System;
using System.IO;
using System.Linq;
using System.Text;
using System.IO.Compression;


namespace ExempleAdaptStream
{
    class Program
    {
        static void Main(string[] args)
        {
            using (FileStream fs=new FileStream("test.txt",FileMode.Create))
            {   byte [] tab=new byte[] {0x49,0x55,0x54}; // "IUT" écrit
                fs.Write(tab, 0, tab.Length);
            }

            using (FileStream fs2 = new FileStream("test2.gztxt", FileMode.Create))
            {
                using (GZipStream compress_fs = new GZipStream(fs2, CompressionMode.Compress))
                {
                    byte[] tab2 = new byte[2048] ;
                    for (uint i=0;i<tab2.Length;i++) tab2[i] = 0x49;
                    compress_fs.Write(tab2, 0, tab2.Length);
                }
            }
        }
    }
}
