[internal] - Use Stream.CopyTo() instead loop thx @xylographe

This commit is contained in:
ivandrofly 2015-09-06 15:42:57 +01:00
parent a98a00e13c
commit 3366abdb44

View File

@ -20,12 +20,7 @@ namespace Nikse.SubtitleEdit.Core
using (var fd = new MemoryStream())
using (Stream csStream = new GZipStream(File.OpenRead(fileName), CompressionMode.Decompress))
{
int nRead;
while ((nRead = csStream.Read(buffer, 0, buffer.Length)) > 0)
{
fd.Write(buffer, 0, nRead);
}
csStream.Flush();
csStream.CopyTo(fd);
buffer = fd.ToArray();
}