mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-02-13 21:31:04 +00:00
Use slightly different zlib port
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="SharpCompress" Version="0.32.2" />
|
||||
<PackageReference Include="zlib.net-mutliplatform" Version="1.0.6" />
|
||||
<PackageReference Include="SharpZipLib" Version="1.4.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using BurnOutSharp.Utilities;
|
||||
using ICSharpCode.SharpZipLib.Zip.Compression;
|
||||
|
||||
namespace BurnOutSharp.Wrappers
|
||||
{
|
||||
@@ -489,6 +490,12 @@ namespace BurnOutSharp.Wrappers
|
||||
/// </summary>
|
||||
protected byte[] DecompressMSZIPData(byte[] data)
|
||||
{
|
||||
// Inflater inflater = new Inflater(noHeader: true);
|
||||
// inflater.SetInput(data);
|
||||
// byte[] outputData = new byte[data.Length * 4];
|
||||
// int read = inflater.Inflate(outputData);
|
||||
// return outputData.AsSpan(0, read).ToArray();
|
||||
|
||||
// Create the bitstream to read from
|
||||
var dataStream = new BitStream(data);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using ComponentAce.Compression.Libs.zlib;
|
||||
using ICSharpCode.SharpZipLib.Zip.Compression;
|
||||
|
||||
namespace BurnOutSharp.Wrappers
|
||||
{
|
||||
@@ -772,16 +772,9 @@ namespace BurnOutSharp.Wrappers
|
||||
{
|
||||
// Decompress the data
|
||||
data = new byte[outputFileSize];
|
||||
ZStream zst = new ZStream
|
||||
{
|
||||
next_in = compressedData,
|
||||
avail_in = compressedData.Length,
|
||||
next_out = data,
|
||||
avail_out = data.Length,
|
||||
};
|
||||
zst.inflateInit();
|
||||
zst.inflate(zlibConst.Z_FULL_FLUSH);
|
||||
zst.inflateEnd();
|
||||
Inflater inflater = new Inflater();
|
||||
inflater.SetInput(compressedData);
|
||||
inflater.Inflate(data);
|
||||
}
|
||||
|
||||
// If we have an invalid output directory
|
||||
|
||||
Reference in New Issue
Block a user