mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Support ancient .NET in FileTypes
This commit is contained in:
@@ -90,7 +90,7 @@ namespace Compress.gZip
|
||||
ZipFileClose();
|
||||
return ZipReturn.ZipErrorOpeningFile;
|
||||
}
|
||||
catch(Exception)
|
||||
catch (Exception)
|
||||
{
|
||||
ZipFileClose();
|
||||
return ZipReturn.ZipErrorReadingFile;
|
||||
@@ -111,7 +111,11 @@ namespace Compress.gZip
|
||||
|
||||
private ZipReturn ZipFileReadHeaders()
|
||||
{
|
||||
#if NET20 || NET35 || NET40
|
||||
using BinaryReader zipBr = new(_zipFs, Encoding.UTF8);
|
||||
#else
|
||||
using BinaryReader zipBr = new(_zipFs, Encoding.UTF8, true);
|
||||
#endif
|
||||
|
||||
byte ID1 = zipBr.ReadByte();
|
||||
byte ID2 = zipBr.ReadByte();
|
||||
@@ -316,7 +320,11 @@ namespace Compress.gZip
|
||||
|
||||
public ZipReturn ZipFileOpenWriteStream(bool raw, bool trrntzip, string filename, ulong unCompressedSize, ushort compressionMethod, out Stream stream, TimeStamps dateTime)
|
||||
{
|
||||
#if NET20 || NET35 || NET40
|
||||
using (BinaryWriter zipBw = new(_zipFs, Encoding.UTF8))
|
||||
#else
|
||||
using (BinaryWriter zipBw = new(_zipFs, Encoding.UTF8, true))
|
||||
#endif
|
||||
{
|
||||
UnCompressedSize = unCompressedSize;
|
||||
|
||||
@@ -422,7 +430,11 @@ namespace Compress.gZip
|
||||
|
||||
CompressedSize = (ulong)(_zipFs.Position - dataStartPos);
|
||||
|
||||
#if NET20 || NET35 || NET40
|
||||
using (BinaryWriter zipBw = new(_zipFs, Encoding.UTF8))
|
||||
#else
|
||||
using (BinaryWriter zipBw = new(_zipFs, Encoding.UTF8, true))
|
||||
#endif
|
||||
{
|
||||
|
||||
zipBw.Write(crc32[3]);
|
||||
|
||||
Reference in New Issue
Block a user