From a37e21e276ea110395f78ef8c5acb6e245b41993 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Fri, 17 Apr 2026 18:46:50 +0100 Subject: [PATCH] Add support for additional parameters in Brimstone and Darkhorse decompression methods --- Aaru.Compression/StuffItX/BrimstoneStream.cs | 6 +++--- Aaru.Compression/StuffItX/DarkhorseStream.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Aaru.Compression/StuffItX/BrimstoneStream.cs b/Aaru.Compression/StuffItX/BrimstoneStream.cs index 65a39682b..34fd0e83c 100644 --- a/Aaru.Compression/StuffItX/BrimstoneStream.cs +++ b/Aaru.Compression/StuffItX/BrimstoneStream.cs @@ -12,7 +12,7 @@ public partial class BrimstoneStream : Stream readonly long _length; long _position; - public BrimstoneStream(Stream compressedStream, long decompressedLength) + public BrimstoneStream(Stream compressedStream, long decompressedLength, int maxOrder, int subAllocSize) { if(compressedStream == null) throw new ArgumentNullException(nameof(compressedStream)); if(!compressedStream.CanRead) throw new ArgumentException("Stream must be readable", nameof(compressedStream)); @@ -28,7 +28,7 @@ public partial class BrimstoneStream : Stream var outLen = (nint)decompressedLength; // Call native decompressor - int err = AARU_stuffitx_brimstone_decode_buffer(_decoded, ref outLen, inBuf, inBuf.Length); + int err = AARU_stuffitx_brimstone_decode_buffer(_decoded, ref outLen, inBuf, inBuf.Length, maxOrder, subAllocSize); if(err != 0) throw new InvalidOperationException("Brimstone decompression failed"); @@ -50,7 +50,7 @@ public partial class BrimstoneStream : Stream [LibraryImport("libAaru.Compression.Native")] public static partial int AARU_stuffitx_brimstone_decode_buffer(byte[] dst_buffer, ref nint dst_size, - byte[] src_buffer, nint src_size); + byte[] src_buffer, nint src_size,int max_order, int sub_alloc_size); public override void Flush() { diff --git a/Aaru.Compression/StuffItX/DarkhorseStream.cs b/Aaru.Compression/StuffItX/DarkhorseStream.cs index 3c8956d9a..9916fd13c 100644 --- a/Aaru.Compression/StuffItX/DarkhorseStream.cs +++ b/Aaru.Compression/StuffItX/DarkhorseStream.cs @@ -12,7 +12,7 @@ public partial class DarkhorseStream : Stream readonly long _length; long _position; - public DarkhorseStream(Stream compressedStream, long decompressedLength) + public DarkhorseStream(Stream compressedStream, long decompressedLength, int windowBits) { if(compressedStream == null) throw new ArgumentNullException(nameof(compressedStream)); if(!compressedStream.CanRead) throw new ArgumentException("Stream must be readable", nameof(compressedStream)); @@ -28,7 +28,7 @@ public partial class DarkhorseStream : Stream var outLen = (nint)decompressedLength; // Call native decompressor - int err = AARU_stuffitx_darkhorse_decode_buffer(_decoded, ref outLen, inBuf, inBuf.Length); + int err = AARU_stuffitx_darkhorse_decode_buffer(_decoded, ref outLen, inBuf, inBuf.Length, windowBits); if(err != 0) throw new InvalidOperationException("Darkhorse decompression failed"); @@ -50,7 +50,7 @@ public partial class DarkhorseStream : Stream [LibraryImport("libAaru.Compression.Native")] public static partial int AARU_stuffitx_darkhorse_decode_buffer(byte[] dst_buffer, ref nint dst_size, - byte[] src_buffer, nint src_size); + byte[] src_buffer, nint src_size, int window_bits); public override void Flush() {