Hi!
I'm making a program that uploads my game to an Ftp server but when the data is compressed something goes wrong and I end up with an array of zeroes.
Here's my code:
FileStream filestream = File.OpenRead(file);
byte[] filebyte = new byte[filestream.Length];
filestream.Read(filebyte, 0, filebyte.Length);
filestream.Close();
//MemoryStream inS = new MemoryStream(filebyte);
MemoryStream outS = new MemoryStream();
GZipStream gzip = new GZipStream(outS, CompressionMode.Compress, true);
//inS.CopyTo((Stream)gzip);
gzip.Write(filebyte, 0, filebyte.Length);
gzip.Close();
byte[] compressed = new byte[outS.Length];
outS.Read(compressed, 0, compressed.Length);
outS.Close();
Please help!