[ZipFile] Use File.OpenRead/OpenWrite

This commit is contained in:
Matt Nadareski
2016-09-16 18:02:45 -07:00
parent b39a81f3d3
commit bd4f5004f1

View File

@@ -401,7 +401,7 @@ namespace SabreTools.Helper
} }
// Now try to open the file for reading // Now try to open the file for reading
_zipstream = new FileStream(filename, FileMode.Open, FileAccess.Read); _zipstream = File.OpenRead(filename);
int read = _zipstream.Read(new byte[1], 0, 1); int read = _zipstream.Read(new byte[1], 0, 1);
if (read != 1) if (read != 1)
{ {
@@ -619,7 +619,7 @@ namespace SabreTools.Helper
_zipFileInfo = new FileInfo(filename); _zipFileInfo = new FileInfo(filename);
// Now try to open the file // Now try to open the file
_zipstream = new FileStream(filename, FileMode.Create, FileAccess.ReadWrite); _zipstream = File.OpenWrite(filename);
ZipOpen = ZipOpenType.OpenWrite; ZipOpen = ZipOpenType.OpenWrite;
return ZipReturn.ZipGood; return ZipReturn.ZipGood;
} }