[ArchiveTools] Fix TorrentZip write

Apparently, only a very specific version of Zlib stuff will work for TZIP. This implementation is copied from RomVault for full compatibility.
This commit is contained in:
Matt Nadareski
2016-10-07 12:16:33 -07:00
parent da0b25bd78
commit 67564aef1a
16 changed files with 8797 additions and 8750 deletions

View File

@@ -1,6 +1,4 @@
using OCRC;
using Ionic.Crc;
using Ionic.Zlib;
using System;
using System.Collections.Generic;
using System.IO;
@@ -137,20 +135,16 @@ namespace SabreTools.Helper
/// </summary>
/// <param name="zipstream">Stream representing the entry</param>
/// <param name="filename">Internal filename to use</param>
/// <param name="torrentZip">True if the file should be set with TorrentZip defaults (default), false otherwise</param>
public ZipFileEntry(Stream zipstream, string filename, bool torrentZip = true)
public ZipFileEntry(Stream zipstream, string filename)
{
_zip64 = false;
_zipstream = zipstream;
_generalPurposeBitFlag = GeneralPurposeBitFlag.DeflatingMaximumCompression;
_compressionMethod = CompressionMethod.Deflated;
FileName = filename;
_lastModFileTime = 48128;
_lastModFileDate = 8600;
if (torrentZip)
{
_lastModFileTime = 48128;
_lastModFileDate = 8600;
}
FileName = filename;
}
#endregion