Read file into Memory Stream MemoryStream SourceXmlMemoryStream = new MemoryStream(File.ReadAllBytes(filename)); Write File From Memory Stream FileStream file = new FileStream(filename, FileMode.Create, FileAccess.Write); //Overwrite the existing file OutputXmlMemoryStream.WriteTo(file); file.Close(); OutputXmlMemoryStream.Close(); Seek SourceXmlMemoryStream.Seek(0, SeekOrigin.Begin); or SourceXmlMemoryStream.Position = 0 Close Memory Stream SourceXmlMemoryStream.Dispose(); Write MemoryStream To File (Overwrite if alreads exists) MemoryStream1.Position = 0; System.IO.File.WriteAllBytes("C:\\_Downloaded\\test1.bin", MemoryStream1.ToArray()); Convert Memory […]