[ZOO] Add support for compression method 2 (LH5).

This commit is contained in:
2025-08-26 02:11:51 +01:00
parent f6e63f3b98
commit 522dacc9cc
3 changed files with 6 additions and 2 deletions

View File

@@ -45,6 +45,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Aaru.CommonTypes\Aaru.CommonTypes.csproj"/>
<ProjectReference Include="..\Aaru.Compression\Aaru.Compression.csproj"/>
<ProjectReference Include="..\Aaru.Logging\Aaru.Logging.csproj"/>
<ProjectReference Include="..\Aaru.Filters\Aaru.Filters.csproj"/>
<ProjectReference Include="..\Aaru.Helpers\Aaru.Helpers.csproj"/>

View File

@@ -6,7 +6,7 @@ namespace Aaru.Archives;
public sealed partial class Zoo : IArchive
{
[LibraryImport("Aaru.Compression.Native")]
[LibraryImport("libAaru.Compression.Native")]
private static partial IntPtr CreateLZDContext();
[LibraryImport("libAaru.Compression.Native")]

View File

@@ -32,6 +32,7 @@ using System.Runtime.InteropServices;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Structs;
using Aaru.Compression;
using Aaru.Filters;
using Aaru.Helpers;
using Aaru.Helpers.IO;
@@ -175,7 +176,7 @@ public sealed partial class Zoo
Direntry entry = _files[entryNumber];
if(entry.packing_method > 1) return ErrorNumber.NotImplemented;
if(entry.packing_method > 2) return ErrorNumber.InvalidArgument;
Stream stream = new OffsetStream(new NonClosableStream(_stream),
_files[entryNumber].offset,
@@ -185,6 +186,8 @@ public sealed partial class Zoo
if(entry.packing_method == 1) stream = new ForcedSeekStream<LzdStream>(entry.org_size, stream);
if(entry.packing_method == 2) stream = new Lh5Stream(stream, entry.org_size);
filter = new ZZZNoFilter();
ErrorNumber errno = filter.Open(stream);