[NDIF] Implement LZH support.

This commit is contained in:
2026-04-19 22:18:48 +01:00
parent 77d05c5cbd
commit c6d9dd1bcd

View File

@@ -143,10 +143,6 @@ public sealed partial class Ndif
case CHUNK_TYPE_KENCODE:
AaruLogging.Error(Localization.Chunks_compressed_with_KenCode_are_not_yet_supported);
return ErrorNumber.NotImplemented;
case CHUNK_TYPE_LZH:
AaruLogging.Error(Localization.Chunks_compressed_with_LZH_are_not_yet_supported);
return ErrorNumber.NotImplemented;
case CHUNK_TYPE_STUFFIT:
AaruLogging.Error(Localization.Chunks_compressed_with_StuffIt_are_not_yet_supported);
@@ -357,6 +353,16 @@ public sealed partial class Ndif
break;
}
case CHUNK_TYPE_LZH:
{
var tmpBuffer = new byte[_bufferSize];
realSize = AppleLzh.DecodeBuffer(cmpBuffer, tmpBuffer);
data = new byte[realSize];
Array.Copy(tmpBuffer, 0, data, 0, realSize);
break;
}
default:
return ErrorNumber.NotSupported;
}