From dcd3eb932a5782fc0e01f88224483e1a6fadbd9b Mon Sep 17 00:00:00 2001 From: Hawkynt Date: Tue, 15 Sep 2026 13:04:35 +0200 Subject: [PATCH 01/10] + add universal archive input bridges --- .../Streaming/ArchiveInputBridge.cs | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 Compression.Registry/Streaming/ArchiveInputBridge.cs diff --git a/Compression.Registry/Streaming/ArchiveInputBridge.cs b/Compression.Registry/Streaming/ArchiveInputBridge.cs new file mode 100644 index 000000000..c00563636 --- /dev/null +++ b/Compression.Registry/Streaming/ArchiveInputBridge.cs @@ -0,0 +1,114 @@ +namespace Compression.Registry.Streaming; + +/// +/// Bridges forward-only archive input to the seek-based reader implementations +/// that pre-date the explicit streaming API. Seekable inputs are passed through; +/// forward-only inputs are spooled to a temporary file so archive size is not +/// bounded by managed-array limits. +/// +internal sealed class SeekableArchiveInputLease : IDisposable { + private const int CopyBufferSize = 128 * 1024; + + private readonly bool _ownsStream; + + /// The readable, seekable view used by the format implementation. + public Stream Stream { get; } + + private SeekableArchiveInputLease(Stream stream, bool ownsStream) { + this.Stream = stream; + this._ownsStream = ownsStream; + } + + /// + /// Returns a seekable view over . When the source is + /// already seekable it is rewound and borrowed; otherwise the remaining bytes + /// are copied to a delete-on-close temporary file owned by the lease. + /// + public static SeekableArchiveInputLease Open(Stream source) { + ArgumentNullException.ThrowIfNull(source); + if (!source.CanRead) + throw new ArgumentException("Archive input must be readable.", nameof(source)); + + if (source.CanSeek) { + source.Position = 0; + return new SeekableArchiveInputLease(source, ownsStream: false); + } + + var path = Path.Combine(Path.GetTempPath(), $"cwb-archive-{Guid.NewGuid():N}.tmp"); + FileStream? spool = null; + try { + spool = new FileStream( + path, + FileMode.CreateNew, + FileAccess.ReadWrite, + FileShare.Read, + CopyBufferSize, + FileOptions.DeleteOnClose | FileOptions.SequentialScan); + source.CopyTo(spool, CopyBufferSize); + spool.Position = 0; + return new SeekableArchiveInputLease(spool, ownsStream: true); + } catch { + spool?.Dispose(); + try { File.Delete(path); } catch { /* best-effort cleanup */ } + throw; + } + } + + /// + public void Dispose() { + if (this._ownsStream) + this.Stream.Dispose(); + } +} + +/// +/// Keeps an auxiliary archive-input owner alive for exactly as long as the +/// returned entry stream. This is required when a forward-only archive was +/// spooled before . +/// +internal sealed class OwnedArchiveEntryStream : Stream { + private readonly Stream _inner; + private readonly IDisposable _owner; + private bool _disposed; + + public OwnedArchiveEntryStream(Stream inner, IDisposable owner) { + ArgumentNullException.ThrowIfNull(inner); + ArgumentNullException.ThrowIfNull(owner); + this._inner = inner; + this._owner = owner; + } + + public override bool CanRead => !this._disposed && this._inner.CanRead; + public override bool CanSeek => !this._disposed && this._inner.CanSeek; + public override bool CanWrite => !this._disposed && this._inner.CanWrite; + public override long Length => this._inner.Length; + + public override long Position { + get => this._inner.Position; + set => this._inner.Position = value; + } + + public override void Flush() => this._inner.Flush(); + public override int Read(byte[] buffer, int offset, int count) => this._inner.Read(buffer, offset, count); + public override int Read(Span buffer) => this._inner.Read(buffer); + public override long Seek(long offset, SeekOrigin origin) => this._inner.Seek(offset, origin); + public override void SetLength(long value) => this._inner.SetLength(value); + public override void Write(byte[] buffer, int offset, int count) => this._inner.Write(buffer, offset, count); + public override void Write(ReadOnlySpan buffer) => this._inner.Write(buffer); + + protected override void Dispose(bool disposing) { + if (this._disposed) { + base.Dispose(disposing); + return; + } + + this._disposed = true; + if (disposing) + try { + this._inner.Dispose(); + } finally { + this._owner.Dispose(); + } + base.Dispose(disposing); + } +} From afacc6ce9e41518e3677b5f1d7e37c8bcfe3cd00 Mon Sep 17 00:00:00 2001 From: Hawkynt Date: Tue, 15 Sep 2026 13:05:10 +0200 Subject: [PATCH 02/10] + expose stream seek and span archive read modes --- .../IArchiveFormatOperations.cs | 155 +++++++++++++++++- 1 file changed, 150 insertions(+), 5 deletions(-) diff --git a/Compression.Registry/IArchiveFormatOperations.cs b/Compression.Registry/IArchiveFormatOperations.cs index 120498064..3073bb4e8 100644 --- a/Compression.Registry/IArchiveFormatOperations.cs +++ b/Compression.Registry/IArchiveFormatOperations.cs @@ -8,13 +8,94 @@ namespace Compression.Registry; /// defragment, shrink, input constraints) are separate opt-in interfaces so callers can /// discover them at the type level. /// +/// +/// +/// The historical / +/// methods remain the descriptor's native compatibility surface. The explicit input-mode methods +/// below make the three archive-reading models available uniformly to every archive and +/// pseudo-archive: forward-only stream input, required-seek input, and in-memory +/// input. +/// +/// +/// Existing descriptors automatically gain all three modes. A descriptor can override the +/// default interface implementations when it has a genuinely streaming parser, a native +/// random-access reader, or a zero-copy span parser. Until then, forward-only streams are +/// spooled to a temporary seekable file and spans are copied once into an owned memory stream; +/// neither fallback imposes a whole-archive managed-array limit on stream input. +/// +/// public interface IArchiveFormatOperations { - /// List all entries in the archive. + /// List all entries in the archive using the descriptor's native stream path. List List(Stream stream, string? password); - /// Extract entries from the archive to an output directory. + /// Extract entries from the archive to an output directory using the descriptor's native stream path. void Extract(Stream stream, string outputDir, string? password, string[]? files); + /// + /// Lists entries from a forward-only or seekable stream. This is the libarchive-style + /// streaming entry point: callers do not need to provide seek capability. + /// + public virtual List ListStreaming(Stream archive, string? password) { + using var lease = SeekableArchiveInputLease.Open(archive); + return this.ListSeekable(lease.Stream, password); + } + + /// + /// Extracts entries from a forward-only or seekable stream. Descriptors with a native + /// one-pass parser should override this method; the default spools only when necessary. + /// + public virtual void ExtractStreaming(Stream archive, string outputDir, string? password, string[]? files) { + using var lease = SeekableArchiveInputLease.Open(archive); + this.ExtractSeekable(lease.Stream, outputDir, password, files); + } + + /// + /// Lists entries through the explicit seek-based path. The supplied stream must support + /// seeking; it is rewound before the descriptor's native reader is invoked. + /// + public virtual List ListSeekable(Stream archive, string? password) { + ArgumentNullException.ThrowIfNull(archive); + if (!archive.CanRead) + throw new ArgumentException("Archive input must be readable.", nameof(archive)); + if (!archive.CanSeek) + throw new ArgumentException("Seek-based archive input must support seeking.", nameof(archive)); + archive.Position = 0; + return this.List(archive, password); + } + + /// + /// Extracts entries through the explicit seek-based path. The supplied stream must support + /// seeking; it is rewound before the descriptor's native reader is invoked. + /// + public virtual void ExtractSeekable(Stream archive, string outputDir, string? password, string[]? files) { + ArgumentNullException.ThrowIfNull(archive); + if (!archive.CanRead) + throw new ArgumentException("Archive input must be readable.", nameof(archive)); + if (!archive.CanSeek) + throw new ArgumentException("Seek-based archive input must support seeking.", nameof(archive)); + archive.Position = 0; + this.Extract(archive, outputDir, password, files); + } + + /// + /// Lists entries from an in-memory archive image. The default compatibility bridge copies + /// the span once because a cannot safely retain a borrowed span; native + /// span parsers should override this method to remain allocation-free. + /// + public virtual List List(ReadOnlySpan archive, string? password) { + using var stream = new MemoryStream(archive.ToArray(), writable: false); + return this.ListSeekable(stream, password); + } + + /// + /// Extracts entries from an in-memory archive image. Native span parsers can override this + /// method to avoid the compatibility copy used by the default implementation. + /// + public virtual void Extract(ReadOnlySpan archive, string outputDir, string? password, string[]? files) { + using var stream = new MemoryStream(archive.ToArray(), writable: false); + this.ExtractSeekable(stream, outputDir, password, files); + } + /// /// Opens a single entry as a read-only bounded to that /// entry's logical bytes — physically incapable of reading slack space, @@ -29,7 +110,7 @@ public interface IArchiveFormatOperations { /// /// /// The default implementation intentionally does not materialize a - /// byte[]. It asks for the selected entry in an + /// byte[]. It asks for the selected entry in an /// isolated temporary directory, opens the resulting file as a seekable /// stream, and deletes that tree on dispose. This gives every descriptor a /// large-file-safe streaming fallback even before it grows a native per-entry @@ -44,13 +125,61 @@ public virtual Stream OpenEntry(Stream archive, string entryName, string? passwo return new BoundedEntryStream(extracted, extracted.Length, leaveOpen: false); } + /// + /// Opens one entry from a forward-only or seekable archive source. A temporary spool, when + /// required, stays alive until the returned entry stream is disposed. + /// + public virtual Stream OpenEntryStreaming(Stream archive, string entryName, string? password) { + ArgumentException.ThrowIfNullOrWhiteSpace(entryName); + var lease = SeekableArchiveInputLease.Open(archive); + try { + var entry = this.OpenEntrySeekable(lease.Stream, entryName, password); + return new OwnedArchiveEntryStream(entry, lease); + } catch { + lease.Dispose(); + throw; + } + } + + /// + /// Opens one entry through the explicit seek-based path. The archive is rewound before the + /// descriptor-specific entry reader is invoked. + /// + public virtual Stream OpenEntrySeekable(Stream archive, string entryName, string? password) { + ArgumentNullException.ThrowIfNull(archive); + ArgumentException.ThrowIfNullOrWhiteSpace(entryName); + if (!archive.CanRead) + throw new ArgumentException("Archive input must be readable.", nameof(archive)); + if (!archive.CanSeek) + throw new ArgumentException("Seek-based archive input must support seeking.", nameof(archive)); + archive.Position = 0; + return this.OpenEntry(archive, entryName, password); + } + + /// + /// Opens one entry from an in-memory archive image. Because the returned stream may outlive + /// this call, the default bridge owns one copy of the supplied span until that stream is disposed. + /// Native span readers can override this method when they can return independently owned output. + /// + public virtual Stream OpenEntry(ReadOnlySpan archive, string entryName, string? password) { + ArgumentException.ThrowIfNullOrWhiteSpace(entryName); + var source = new MemoryStream(archive.ToArray(), writable: false); + try { + var entry = this.OpenEntrySeekable(source, entryName, password); + return new OwnedArchiveEntryStream(entry, source); + } catch { + source.Dispose(); + throw; + } + } + /// /// Extracts a single entry to a byte array. This is the explicitly buffered /// convenience API; callers working with large entries should use - /// instead. + /// instead. /// /// - /// The default routes through , so descriptor-specific + /// The default routes through , so descriptor-specific /// isolation/decoding semantics are preserved. A result past the runtime array /// limit naturally fails here rather than imposing that limit on the streaming /// API or filesystem-driver layer. @@ -64,4 +193,20 @@ public virtual byte[] ExtractEntryToMemory(Stream archive, string entryName, str entry.CopyTo(memory); return memory.ToArray(); } + + /// Extracts one entry from a forward-only or seekable archive source into memory. + public virtual byte[] ExtractEntryToMemoryStreaming(Stream archive, string entryName, string? password) { + using var entry = this.OpenEntryStreaming(archive, entryName, password); + using var memory = new MemoryStream(); + entry.CopyTo(memory); + return memory.ToArray(); + } + + /// Extracts one entry from an in-memory archive image into a new byte array. + public virtual byte[] ExtractEntryToMemory(ReadOnlySpan archive, string entryName, string? password) { + using var entry = this.OpenEntry(archive, entryName, password); + using var memory = new MemoryStream(); + entry.CopyTo(memory); + return memory.ToArray(); + } } From 7214cf037a1f42bef2304caed683669cb0b85342 Mon Sep 17 00:00:00 2001 From: Hawkynt Date: Tue, 15 Sep 2026 13:05:39 +0200 Subject: [PATCH 03/10] + expose archive input modes on concrete descriptors --- .../ArchiveFormatOperationsExtensions.cs | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 Compression.Registry/ArchiveFormatOperationsExtensions.cs diff --git a/Compression.Registry/ArchiveFormatOperationsExtensions.cs b/Compression.Registry/ArchiveFormatOperationsExtensions.cs new file mode 100644 index 000000000..af5d07360 --- /dev/null +++ b/Compression.Registry/ArchiveFormatOperationsExtensions.cs @@ -0,0 +1,96 @@ +namespace Compression.Registry; + +/// +/// Makes the default archive input-mode members available when a descriptor is +/// referenced by its concrete type. Default interface members are otherwise only +/// in the member set of an reference. +/// +public static class ArchiveFormatOperationsExtensions { + /// + public static List ListStreaming( + this IArchiveFormatOperations operations, + Stream archive, + string? password) + => operations.ListStreaming(archive, password); + + /// + public static void ExtractStreaming( + this IArchiveFormatOperations operations, + Stream archive, + string outputDir, + string? password, + string[]? files) + => operations.ExtractStreaming(archive, outputDir, password, files); + + /// + public static List ListSeekable( + this IArchiveFormatOperations operations, + Stream archive, + string? password) + => operations.ListSeekable(archive, password); + + /// + public static void ExtractSeekable( + this IArchiveFormatOperations operations, + Stream archive, + string outputDir, + string? password, + string[]? files) + => operations.ExtractSeekable(archive, outputDir, password, files); + + /// + public static List List( + this IArchiveFormatOperations operations, + ReadOnlySpan archive, + string? password) + => operations.List(archive, password); + + /// + public static void Extract( + this IArchiveFormatOperations operations, + ReadOnlySpan archive, + string outputDir, + string? password, + string[]? files) + => operations.Extract(archive, outputDir, password, files); + + /// + public static Stream OpenEntryStreaming( + this IArchiveFormatOperations operations, + Stream archive, + string entryName, + string? password) + => operations.OpenEntryStreaming(archive, entryName, password); + + /// + public static Stream OpenEntrySeekable( + this IArchiveFormatOperations operations, + Stream archive, + string entryName, + string? password) + => operations.OpenEntrySeekable(archive, entryName, password); + + /// + public static Stream OpenEntry( + this IArchiveFormatOperations operations, + ReadOnlySpan archive, + string entryName, + string? password) + => operations.OpenEntry(archive, entryName, password); + + /// + public static byte[] ExtractEntryToMemoryStreaming( + this IArchiveFormatOperations operations, + Stream archive, + string entryName, + string? password) + => operations.ExtractEntryToMemoryStreaming(archive, entryName, password); + + /// + public static byte[] ExtractEntryToMemory( + this IArchiveFormatOperations operations, + ReadOnlySpan archive, + string entryName, + string? password) + => operations.ExtractEntryToMemory(archive, entryName, password); +} From e48b594535a97850f2a86ca020bd63b6b92794ab Mon Sep 17 00:00:00 2001 From: Hawkynt Date: Tue, 15 Sep 2026 13:06:00 +0200 Subject: [PATCH 04/10] + test universal archive input modes --- .../Registry/ArchiveInputModeTests.cs | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 Compression.Tests/Registry/ArchiveInputModeTests.cs diff --git a/Compression.Tests/Registry/ArchiveInputModeTests.cs b/Compression.Tests/Registry/ArchiveInputModeTests.cs new file mode 100644 index 000000000..67aeb0f30 --- /dev/null +++ b/Compression.Tests/Registry/ArchiveInputModeTests.cs @@ -0,0 +1,148 @@ +using Compression.Registry; +using Compression.Registry.Streaming; + +namespace Compression.Tests.Registry; + +/// +/// Verifies the universal archive input bridges. The fake descriptor intentionally +/// implements only the historical seek-dependent Stream methods; every new mode +/// must therefore work through the default registry contract rather than through +/// format-specific test code. +/// +[TestFixture] +public sealed class ArchiveInputModeTests { + private static readonly byte[] ArchiveBytes = "TESTpayload"u8.ToArray(); + private static readonly byte[] EntryBytes = "payload"u8.ToArray(); + + [Test, Category("Spec")] + public void ListStreaming_ForwardOnlySource_SpoolsAndLists() { + IArchiveFormatOperations ops = new SeekOnlyArchiveOperations(); + using var inner = new MemoryStream(ArchiveBytes, writable: false); + using var source = new NonSeekableReadStream(inner); + + var entries = ops.ListStreaming(source, password: null); + + Assert.That(entries, Has.Count.EqualTo(1)); + Assert.That(entries[0].Name, Is.EqualTo("payload.bin")); + Assert.That(entries[0].OriginalSize, Is.EqualTo(EntryBytes.Length)); + } + + [Test, Category("Spec")] + public void ListSeekable_ForwardOnlySource_RejectsCapabilityMismatch() { + IArchiveFormatOperations ops = new SeekOnlyArchiveOperations(); + using var inner = new MemoryStream(ArchiveBytes, writable: false); + using var source = new NonSeekableReadStream(inner); + + Assert.That( + () => ops.ListSeekable(source, password: null), + Throws.ArgumentException.With.Message.Contains("must support seeking")); + } + + [Test, Category("Spec")] + public void ListSpan_ConcreteDescriptor_UsesUniversalSpanSurface() { + var ops = new SeekOnlyArchiveOperations(); + + var entries = ops.List(ArchiveBytes.AsSpan(), password: null); + + Assert.That(entries, Has.Count.EqualTo(1)); + Assert.That(entries[0].Name, Is.EqualTo("payload.bin")); + } + + [Test, Category("Spec")] + public void ExtractStreaming_ForwardOnlySource_ExtractsSelectedEntry() { + IArchiveFormatOperations ops = new SeekOnlyArchiveOperations(); + using var inner = new MemoryStream(ArchiveBytes, writable: false); + using var source = new NonSeekableReadStream(inner); + var outputDir = Path.Combine(Path.GetTempPath(), $"cwb-input-mode-{Guid.NewGuid():N}"); + + try { + ops.ExtractStreaming(source, outputDir, password: null, files: ["payload.bin"]); + Assert.That(File.ReadAllBytes(Path.Combine(outputDir, "payload.bin")), Is.EqualTo(EntryBytes)); + } finally { + try { if (Directory.Exists(outputDir)) Directory.Delete(outputDir, recursive: true); } catch { /* best effort */ } + } + } + + [Test, Category("Spec")] + public void OpenEntryStreaming_ForwardOnlySource_KeepsSpoolAliveUntilEntryIsDisposed() { + IArchiveFormatOperations ops = new SeekOnlyArchiveOperations(); + using var inner = new MemoryStream(ArchiveBytes, writable: false); + using var source = new NonSeekableReadStream(inner); + + using var entry = ops.OpenEntryStreaming(source, "payload.bin", password: null); + using var sink = new MemoryStream(); + entry.CopyTo(sink); + + Assert.That(sink.ToArray(), Is.EqualTo(EntryBytes)); + } + + [Test, Category("Spec")] + public void OpenEntrySpan_OwnsCompatibilityBufferForReturnedStreamLifetime() { + var ops = new SeekOnlyArchiveOperations(); + + using var entry = ops.OpenEntry(ArchiveBytes.AsSpan(), "payload.bin", password: null); + using var sink = new MemoryStream(); + entry.CopyTo(sink); + + Assert.That(sink.ToArray(), Is.EqualTo(EntryBytes)); + } + + private sealed class SeekOnlyArchiveOperations : IArchiveFormatOperations { + public List List(Stream stream, string? password) { + VerifyHeader(stream); + return [new ArchiveEntryInfo( + 0, + "payload.bin", + EntryBytes.Length, + EntryBytes.Length, + "stored", + IsDirectory: false, + IsEncrypted: false, + LastModified: null)]; + } + + public void Extract(Stream stream, string outputDir, string? password, string[]? files) { + VerifyHeader(stream); + if (files is { Length: > 0 } && !files.Contains("payload.bin", StringComparer.Ordinal)) + return; + + Directory.CreateDirectory(outputDir); + stream.Position = 4; + var data = new byte[EntryBytes.Length]; + stream.ReadExactly(data); + File.WriteAllBytes(Path.Combine(outputDir, "payload.bin"), data); + } + + public Stream OpenEntry(Stream archive, string entryName, string? password) { + if (!string.Equals(entryName, "payload.bin", StringComparison.Ordinal)) + throw new FileNotFoundException("Entry not found.", entryName); + VerifyHeader(archive); + archive.Position = 4; + return new BoundedEntryStream(archive, EntryBytes.Length, leaveOpen: true); + } + + private static void VerifyHeader(Stream stream) { + if (!stream.CanSeek) + throw new NotSupportedException("This fake represents a legacy seek-only descriptor."); + stream.Position = 0; + Span header = stackalloc byte[4]; + stream.ReadExactly(header); + if (!header.SequenceEqual("TEST"u8)) + throw new InvalidDataException("Bad test archive header."); + } + } + + private sealed class NonSeekableReadStream(Stream inner) : Stream { + public override bool CanRead => true; + public override bool CanSeek => false; + public override bool CanWrite => false; + public override long Length => throw new NotSupportedException(); + public override long Position { get => throw new NotSupportedException(); set => throw new NotSupportedException(); } + public override void Flush() { } + public override int Read(byte[] buffer, int offset, int count) => inner.Read(buffer, offset, count); + public override int Read(Span buffer) => inner.Read(buffer); + public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException(); + public override void SetLength(long value) => throw new NotSupportedException(); + public override void Write(byte[] buffer, int offset, int count) => throw new NotSupportedException(); + } +} From eb604fbc7eb257704fdeaec760d2d30deaab5989 Mon Sep 17 00:00:00 2001 From: Hawkynt Date: Tue, 15 Sep 2026 13:11:44 +0200 Subject: [PATCH 05/10] # correct archive API XML references --- Compression.Registry/IArchiveFormatOperations.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Compression.Registry/IArchiveFormatOperations.cs b/Compression.Registry/IArchiveFormatOperations.cs index 3073bb4e8..d7c88128f 100644 --- a/Compression.Registry/IArchiveFormatOperations.cs +++ b/Compression.Registry/IArchiveFormatOperations.cs @@ -10,7 +10,7 @@ namespace Compression.Registry; /// /// /// -/// The historical / +/// The historical / Extract(Stream, ...) /// methods remain the descriptor's native compatibility surface. The explicit input-mode methods /// below make the three archive-reading models available uniformly to every archive and /// pseudo-archive: forward-only stream input, required-seek input, and in-memory @@ -110,7 +110,7 @@ public virtual void Extract(ReadOnlySpan archive, string outputDir, string /// /// /// The default implementation intentionally does not materialize a - /// byte[]. It asks for the selected entry in an + /// byte[]. It asks Extract(Stream, ...) for the selected entry in an /// isolated temporary directory, opens the resulting file as a seekable /// stream, and deletes that tree on dispose. This gives every descriptor a /// large-file-safe streaming fallback even before it grows a native per-entry From afaef5ef3c612cd860597235fe1408dc87a08bcb Mon Sep 17 00:00:00 2001 From: Hawkynt Date: Tue, 15 Sep 2026 13:13:10 +0200 Subject: [PATCH 06/10] # correct span extension XML reference --- Compression.Registry/ArchiveFormatOperationsExtensions.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Compression.Registry/ArchiveFormatOperationsExtensions.cs b/Compression.Registry/ArchiveFormatOperationsExtensions.cs index af5d07360..240c719b6 100644 --- a/Compression.Registry/ArchiveFormatOperationsExtensions.cs +++ b/Compression.Registry/ArchiveFormatOperationsExtensions.cs @@ -38,14 +38,14 @@ public static void ExtractSeekable( string[]? files) => operations.ExtractSeekable(archive, outputDir, password, files); - /// + /// Lists entries from an in-memory archive image. public static List List( this IArchiveFormatOperations operations, ReadOnlySpan archive, string? password) => operations.List(archive, password); - /// + /// Extracts entries from an in-memory archive image. public static void Extract( this IArchiveFormatOperations operations, ReadOnlySpan archive, @@ -70,7 +70,7 @@ public static Stream OpenEntrySeekable( string? password) => operations.OpenEntrySeekable(archive, entryName, password); - /// + /// Opens one entry from an in-memory archive image. public static Stream OpenEntry( this IArchiveFormatOperations operations, ReadOnlySpan archive, @@ -86,7 +86,7 @@ public static byte[] ExtractEntryToMemoryStreaming( string? password) => operations.ExtractEntryToMemoryStreaming(archive, entryName, password); - /// + /// Extracts one entry from an in-memory archive image into a new byte array. public static byte[] ExtractEntryToMemory( this IArchiveFormatOperations operations, ReadOnlySpan archive, From a87f8c42b5446ca99c3b3c7681458908efc28fc2 Mon Sep 17 00:00:00 2001 From: Hawkynt Date: Tue, 15 Sep 2026 13:18:15 +0200 Subject: [PATCH 07/10] * make archive input modes explicitly symmetric --- Compression.Registry/IArchiveFormatOperations.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Compression.Registry/IArchiveFormatOperations.cs b/Compression.Registry/IArchiveFormatOperations.cs index d7c88128f..cd96ae278 100644 --- a/Compression.Registry/IArchiveFormatOperations.cs +++ b/Compression.Registry/IArchiveFormatOperations.cs @@ -82,7 +82,7 @@ public virtual void ExtractSeekable(Stream archive, string outputDir, string? pa /// the span once because a cannot safely retain a borrowed span; native /// span parsers should override this method to remain allocation-free. /// - public virtual List List(ReadOnlySpan archive, string? password) { + public virtual List ListSpan(ReadOnlySpan archive, string? password) { using var stream = new MemoryStream(archive.ToArray(), writable: false); return this.ListSeekable(stream, password); } @@ -91,7 +91,7 @@ public virtual List List(ReadOnlySpan archive, string? p /// Extracts entries from an in-memory archive image. Native span parsers can override this /// method to avoid the compatibility copy used by the default implementation. /// - public virtual void Extract(ReadOnlySpan archive, string outputDir, string? password, string[]? files) { + public virtual void ExtractSpan(ReadOnlySpan archive, string outputDir, string? password, string[]? files) { using var stream = new MemoryStream(archive.ToArray(), writable: false); this.ExtractSeekable(stream, outputDir, password, files); } @@ -161,7 +161,7 @@ public virtual Stream OpenEntrySeekable(Stream archive, string entryName, string /// this call, the default bridge owns one copy of the supplied span until that stream is disposed. /// Native span readers can override this method when they can return independently owned output. /// - public virtual Stream OpenEntry(ReadOnlySpan archive, string entryName, string? password) { + public virtual Stream OpenEntrySpan(ReadOnlySpan archive, string entryName, string? password) { ArgumentException.ThrowIfNullOrWhiteSpace(entryName); var source = new MemoryStream(archive.ToArray(), writable: false); try { @@ -203,8 +203,8 @@ public virtual byte[] ExtractEntryToMemoryStreaming(Stream archive, string entry } /// Extracts one entry from an in-memory archive image into a new byte array. - public virtual byte[] ExtractEntryToMemory(ReadOnlySpan archive, string entryName, string? password) { - using var entry = this.OpenEntry(archive, entryName, password); + public virtual byte[] ExtractEntryToMemorySpan(ReadOnlySpan archive, string entryName, string? password) { + using var entry = this.OpenEntrySpan(archive, entryName, password); using var memory = new MemoryStream(); entry.CopyTo(memory); return memory.ToArray(); From 12217b4ab32baf2e63f30efb422bbafe23a1ed65 Mon Sep 17 00:00:00 2001 From: Hawkynt Date: Tue, 15 Sep 2026 13:19:03 +0200 Subject: [PATCH 08/10] * align archive extension names with input modes --- .../ArchiveFormatOperationsExtensions.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Compression.Registry/ArchiveFormatOperationsExtensions.cs b/Compression.Registry/ArchiveFormatOperationsExtensions.cs index 240c719b6..2ccd49322 100644 --- a/Compression.Registry/ArchiveFormatOperationsExtensions.cs +++ b/Compression.Registry/ArchiveFormatOperationsExtensions.cs @@ -38,21 +38,21 @@ public static void ExtractSeekable( string[]? files) => operations.ExtractSeekable(archive, outputDir, password, files); - /// Lists entries from an in-memory archive image. - public static List List( + /// + public static List ListSpan( this IArchiveFormatOperations operations, ReadOnlySpan archive, string? password) - => operations.List(archive, password); + => operations.ListSpan(archive, password); - /// Extracts entries from an in-memory archive image. - public static void Extract( + /// + public static void ExtractSpan( this IArchiveFormatOperations operations, ReadOnlySpan archive, string outputDir, string? password, string[]? files) - => operations.Extract(archive, outputDir, password, files); + => operations.ExtractSpan(archive, outputDir, password, files); /// public static Stream OpenEntryStreaming( @@ -70,13 +70,13 @@ public static Stream OpenEntrySeekable( string? password) => operations.OpenEntrySeekable(archive, entryName, password); - /// Opens one entry from an in-memory archive image. - public static Stream OpenEntry( + /// + public static Stream OpenEntrySpan( this IArchiveFormatOperations operations, ReadOnlySpan archive, string entryName, string? password) - => operations.OpenEntry(archive, entryName, password); + => operations.OpenEntrySpan(archive, entryName, password); /// public static byte[] ExtractEntryToMemoryStreaming( @@ -86,11 +86,11 @@ public static byte[] ExtractEntryToMemoryStreaming( string? password) => operations.ExtractEntryToMemoryStreaming(archive, entryName, password); - /// Extracts one entry from an in-memory archive image into a new byte array. - public static byte[] ExtractEntryToMemory( + /// + public static byte[] ExtractEntryToMemorySpan( this IArchiveFormatOperations operations, ReadOnlySpan archive, string entryName, string? password) - => operations.ExtractEntryToMemory(archive, entryName, password); + => operations.ExtractEntryToMemorySpan(archive, entryName, password); } From 62d7d86adc6dc2de00e301239c37b52870d11364 Mon Sep 17 00:00:00 2001 From: Hawkynt Date: Sat, 19 Sep 2026 04:20:47 +0200 Subject: [PATCH 09/10] * test explicit span archive input mode --- Compression.Tests/Registry/ArchiveInputModeTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Compression.Tests/Registry/ArchiveInputModeTests.cs b/Compression.Tests/Registry/ArchiveInputModeTests.cs index 67aeb0f30..4f31002be 100644 --- a/Compression.Tests/Registry/ArchiveInputModeTests.cs +++ b/Compression.Tests/Registry/ArchiveInputModeTests.cs @@ -42,7 +42,7 @@ public void ListSeekable_ForwardOnlySource_RejectsCapabilityMismatch() { public void ListSpan_ConcreteDescriptor_UsesUniversalSpanSurface() { var ops = new SeekOnlyArchiveOperations(); - var entries = ops.List(ArchiveBytes.AsSpan(), password: null); + var entries = ops.ListSpan(ArchiveBytes.AsSpan(), password: null); Assert.That(entries, Has.Count.EqualTo(1)); Assert.That(entries[0].Name, Is.EqualTo("payload.bin")); @@ -80,7 +80,7 @@ public void OpenEntryStreaming_ForwardOnlySource_KeepsSpoolAliveUntilEntryIsDisp public void OpenEntrySpan_OwnsCompatibilityBufferForReturnedStreamLifetime() { var ops = new SeekOnlyArchiveOperations(); - using var entry = ops.OpenEntry(ArchiveBytes.AsSpan(), "payload.bin", password: null); + using var entry = ops.OpenEntrySpan(ArchiveBytes.AsSpan(), "payload.bin", password: null); using var sink = new MemoryStream(); entry.CopyTo(sink); From 6eacce55307cc0f2370d3a2865149fe07cf7ee34 Mon Sep 17 00:00:00 2001 From: Hawkynt Date: Sat, 19 Sep 2026 04:20:47 +0200 Subject: [PATCH 10/10] * regenerate the package API reference for the input-mode surface --- Compression.Core/README.md | 2 +- Compression.Core/REFERENCE.md | 35 +++++++++++++++++++++-- Hawkynt.FileFormats.Archives/README.md | 2 +- Hawkynt.FileFormats.Archives/REFERENCE.md | 35 +++++++++++++++++++++-- Hawkynt.FileFormats.Audio/README.md | 2 +- Hawkynt.FileFormats.Audio/REFERENCE.md | 35 +++++++++++++++++++++-- 6 files changed, 99 insertions(+), 12 deletions(-) diff --git a/Compression.Core/README.md b/Compression.Core/README.md index 3d612fc8a..9d5077ac1 100644 --- a/Compression.Core/README.md +++ b/Compression.Core/README.md @@ -204,7 +204,7 @@ Use the concrete version you intend to consume; this document does not predict a -Every public and protected member of all 681 types, generated from the built assembly and its XML documentation, is in [REFERENCE.md](https://github.com/Hawkynt/CompressionWorkbench/blob/main/Compression.Core/REFERENCE.md). +Every public and protected member of all 682 types, generated from the built assembly and its XML documentation, is in [REFERENCE.md](https://github.com/Hawkynt/CompressionWorkbench/blob/main/Compression.Core/REFERENCE.md). diff --git a/Compression.Core/REFERENCE.md b/Compression.Core/REFERENCE.md index 3b327de44..4b217ff8f 100644 --- a/Compression.Core/REFERENCE.md +++ b/Compression.Core/REFERENCE.md @@ -6339,7 +6339,7 @@ Run-Length Encoding (RLE) transform. Encodes runs of identical bytes as (count, ### Namespace `Compression.Registry` -[`AlgorithmFamily`](#algorithmfamily) · [`ApeTagReader`](#apetagreader) · [`ApeTagReader.ApeTag`](#apetagreaderapetag) · [`ArchiveEntryInfo`](#archiveentryinfo) · [`ArchiveInputInfo`](#archiveinputinfo) · [`ArchiveMutationOptions`](#archivemutationoptions) · [`ArchiveShrinker`](#archiveshrinker) · [`AudioEncodedStream`](#audioencodedstream) · [`AudioPacket`](#audiopacket) · [`AudioPcmBuffer`](#audiopcmbuffer) · [`AudioPcmEncoding`](#audiopcmencoding) · [`AudioPcmFormat`](#audiopcmformat) · [`AudioPseudoArchive`](#audiopseudoarchive) · [`AudioPseudoArchive.Entry`](#audiopseudoarchiveentry) · [`AudioStreamFormat`](#audiostreamformat) · [`BlockDeviceGeometry`](#blockdevicegeometry) · [`BlockDeviceStream`](#blockdevicestream) · [`BuildingBlockRegistry`](#buildingblockregistry) · [`CompoundTarDescriptor`](#compoundtardescriptor) · [`DefragBlockClass`](#defragblockclass) · [`DefragBlockInfo`](#defragblockinfo) · [`DefragBlockKind`](#defragblockkind) · [`DefragContentGuard`](#defragcontentguard) · [`DefragMode`](#defragmode) · [`DefragOptions`](#defragoptions) · [`DefragProgressEvent`](#defragprogressevent) · [`DefragRebuilder`](#defragrebuilder) · [`EntropyDetector`](#entropydetector) · [`FatDirStamp`](#fatdirstamp) · [`FilesystemAllocationMapCompleter`](#filesystemallocationmapcompleter) · [`FilesystemCompressionParameter`](#filesystemcompressionparameter) · [`FilesystemCompressionProfile`](#filesystemcompressionprofile) · [`FilesystemDirectoryEntry`](#filesystemdirectoryentry) · [`FilesystemDriverBindingKind`](#filesystemdriverbindingkind) · [`FilesystemDriverCapabilities`](#filesystemdrivercapabilities) · [`FilesystemDriverCoverage`](#filesystemdrivercoverage) · [`FilesystemDriverDerivation`](#filesystemdriverderivation) · [`FilesystemDriverProfile`](#filesystemdriverprofile) · [`FilesystemDriverReadinessLayer`](#filesystemdriverreadinesslayer) · [`FilesystemDriverReadinessReport`](#filesystemdriverreadinessreport) · [`FilesystemDriverTarget`](#filesystemdrivertarget) · [`FilesystemMetadataPatch`](#filesystemmetadatapatch) · [`FilesystemMutationModel`](#filesystemmutationmodel) · [`FilesystemNodeId`](#filesystemnodeid) · [`FilesystemNodeInfo`](#filesystemnodeinfo) · [`FilesystemNodeKind`](#filesystemnodekind) · [`FilesystemOpenOptions`](#filesystemopenoptions) · [`FilesystemOptimization`](#filesystemoptimization) · [`FilesystemOptimizationAdapters`](#filesystemoptimizationadapters) · [`FilesystemOptimizationAdapters.HardLinkDeduplicator`](#filesystemoptimizationadaptershardlinkdeduplicator) · [`FilesystemOptimizationAdapters.SymbolicLinkDeduplicator`](#filesystemoptimizationadapterssymboliclinkdeduplicator) · [`FilesystemOptimizationExtensions`](#filesystemoptimizationextensions) · [`FilesystemOptimizationFeatures`](#filesystemoptimizationfeatures) · [`FilesystemOptimizationOptions`](#filesystemoptimizationoptions) · [`FilesystemSchemaPresets`](#filesystemschemapresets) · [`FilesystemSnapshotDirectoryEntry`](#filesystemsnapshotdirectoryentry) · [`FilesystemSnapshotNode`](#filesystemsnapshotnode) · [`FormatCapabilities`](#formatcapabilities) · [`FormatCategory`](#formatcategory) · [`FormatCreateOptions`](#formatcreateoptions) · [`FormatDetectionSignature`](#formatdetectionsignature) · [`FormatHeaderMatch`](#formatheadermatch) · [`FormatHealth`](#formathealth) · [`FormatHelpers`](#formathelpers) · [`FormatMethodInfo`](#formatmethodinfo) · [`FormatOptionDescriptor`](#formatoptiondescriptor) · [`FormatOptionKeys`](#formatoptionkeys) · [`FormatOptionKind`](#formatoptionkind) · [`FormatRegistry`](#formatregistry) · [`HardLinkDeduplicationSemantics`](#hardlinkdeduplicationsemantics) · [`IArchiveCreatable`](#iarchivecreatable) · [`IArchiveDefragmentable`](#iarchivedefragmentable) · [`IArchiveFormatOperations`](#iarchiveformatoperations) · [`IArchiveInMemoryExtract`](#iarchiveinmemoryextract) · [`IArchiveLayoutMap`](#iarchivelayoutmap) · [`IArchiveModifiable`](#iarchivemodifiable) · [`IArchivePurgeable`](#iarchivepurgeable) · [`IArchiveShrinkable`](#iarchiveshrinkable) · [`IArchiveWriteConstraints`](#iarchivewriteconstraints) · [`IAsyncArchiveOperations`](#iasyncarchiveoperations) · [`IAudioContainerFormat`](#iaudiocontainerformat) · [`IAudioDemuxSource`](#iaudiodemuxsource) · [`IAudioMuxTarget`](#iaudiomuxtarget) · [`IAudioPcmSource`](#iaudiopcmsource) · [`IAudioPcmTarget`](#iaudiopcmtarget) · [`IBlockDeviceFilesystemDriverProvider`](#iblockdevicefilesystemdriverprovider) · [`IBlockDeviceProvider`](#iblockdeviceprovider) · [`IBuildingBlock`](#ibuildingblock) · [`IContainerRemuxable`](#icontainerremuxable) · [`IFileInternalChunkMover`](#ifileinternalchunkmover) · [`IFileInternalLayoutMap`](#ifileinternallayoutmap) · [`IFilesystemBlockMover`](#ifilesystemblockmover) · [`IFilesystemDriverAdapter`](#ifilesystemdriveradapter) · [`IFilesystemDriverProvider`](#ifilesystemdriverprovider) · [`IFilesystemDriverReadinessProvider`](#ifilesystemdriverreadinessprovider) · [`IFilesystemExtentMap`](#ifilesystemextentmap) · [`IFilesystemFileHandle`](#ifilesystemfilehandle) · [`IFilesystemMetadataMover`](#ifilesystemmetadatamover) · [`IFilesystemPlaceable`](#ifilesystemplaceable) · [`IFilesystemScrambleable`](#ifilesystemscrambleable) · [`IFilesystemSession`](#ifilesystemsession) · [`IFilesystemTransaction`](#ifilesystemtransaction) · [`IFormatDescriptor`](#iformatdescriptor) · [`IFormatDetectionSource`](#iformatdetectionsource) · [`IFormatOptionsSchema`](#iformatoptionsschema) · [`IFormatValidator`](#iformatvalidator) · [`ILayoutOptimizable`](#ilayoutoptimizable) · [`IPartitionEditable`](#ipartitioneditable) · [`IRandomAccessBlockDevice`](#irandomaccessblockdevice) · [`IRandomAccessBlockDeviceProvider`](#irandomaccessblockdeviceprovider) · [`IRawTrackDevice`](#irawtrackdevice) · [`IRawTrackDeviceProvider`](#irawtrackdeviceprovider) · [`IStreamFormatOperations`](#istreamformatoperations) · [`ISymbolicLinkDeduplicationLayout`](#isymboliclinkdeduplicationlayout) · [`ISyntheticEntryNames`](#isyntheticentrynames) · [`IWipeEmpty`](#iwipeempty) · [`InnerFsDetector`](#innerfsdetector) · [`IssueSeverity`](#issueseverity) · [`LayoutAnalysis`](#layoutanalysis) · [`LayoutPatch`](#layoutpatch) · [`LayoutProfile`](#layoutprofile) · [`LayoutRebuildOptions`](#layoutrebuildoptions) · [`LayoutReclaim`](#layoutreclaim) · [`MagicSignature`](#magicsignature) · [`MediaProfile`](#mediaprofile) · [`MediaProfileLookup`](#mediaprofilelookup) · [`MetadataPlacementProfile`](#metadataplacementprofile) · [`MetadataPlacementRule`](#metadataplacementrule) · [`MetadataZone`](#metadatazone) · [`MethodNameParser`](#methodnameparser) · [`ModifyRebuilder`](#modifyrebuilder) · [`MutableRebuildFilesystemSession`](#mutablerebuildfilesystemsession) · [`MutableRebuildFilesystemSession.RebuildImage`](#mutablerebuildfilesystemsessionrebuildimage) · [`MutableRebuildFilesystemSession.ValidateImage`](#mutablerebuildfilesystemsessionvalidateimage) · [`PartitionBlockDevice`](#partitionblockdevice) · [`PlacementOptions`](#placementoptions) · [`PlacementZone`](#placementzone) · [`RawDiskShrinkRebuilder`](#rawdiskshrinkrebuilder) · [`RawTrackInfo`](#rawtrackinfo) · [`ReadOnlyFilesystemSnapshotSession`](#readonlyfilesystemsnapshotsession) · [`RebuildFilesystemEntry`](#rebuildfilesystementry) · [`RebuildVerb`](#rebuildverb) · [`ScrambleOptions`](#scrambleoptions) · [`SpoolingReadOnlyFileHandle`](#spoolingreadonlyfilehandle) · [`StreamBlockDevice`](#streamblockdevice) · [`SymlinkResolver`](#symlinkresolver) · [`UnusedSpaceWiper`](#unusedspacewiper) · [`ValidationIssue`](#validationissue) · [`ValidationLevel`](#validationlevel) · [`ValidationResult`](#validationresult) · [`WholeImageRebuildCommitter`](#wholeimagerebuildcommitter) +[`AlgorithmFamily`](#algorithmfamily) · [`ApeTagReader`](#apetagreader) · [`ApeTagReader.ApeTag`](#apetagreaderapetag) · [`ArchiveEntryInfo`](#archiveentryinfo) · [`ArchiveFormatOperationsExtensions`](#archiveformatoperationsextensions) · [`ArchiveInputInfo`](#archiveinputinfo) · [`ArchiveMutationOptions`](#archivemutationoptions) · [`ArchiveShrinker`](#archiveshrinker) · [`AudioEncodedStream`](#audioencodedstream) · [`AudioPacket`](#audiopacket) · [`AudioPcmBuffer`](#audiopcmbuffer) · [`AudioPcmEncoding`](#audiopcmencoding) · [`AudioPcmFormat`](#audiopcmformat) · [`AudioPseudoArchive`](#audiopseudoarchive) · [`AudioPseudoArchive.Entry`](#audiopseudoarchiveentry) · [`AudioStreamFormat`](#audiostreamformat) · [`BlockDeviceGeometry`](#blockdevicegeometry) · [`BlockDeviceStream`](#blockdevicestream) · [`BuildingBlockRegistry`](#buildingblockregistry) · [`CompoundTarDescriptor`](#compoundtardescriptor) · [`DefragBlockClass`](#defragblockclass) · [`DefragBlockInfo`](#defragblockinfo) · [`DefragBlockKind`](#defragblockkind) · [`DefragContentGuard`](#defragcontentguard) · [`DefragMode`](#defragmode) · [`DefragOptions`](#defragoptions) · [`DefragProgressEvent`](#defragprogressevent) · [`DefragRebuilder`](#defragrebuilder) · [`EntropyDetector`](#entropydetector) · [`FatDirStamp`](#fatdirstamp) · [`FilesystemAllocationMapCompleter`](#filesystemallocationmapcompleter) · [`FilesystemCompressionParameter`](#filesystemcompressionparameter) · [`FilesystemCompressionProfile`](#filesystemcompressionprofile) · [`FilesystemDirectoryEntry`](#filesystemdirectoryentry) · [`FilesystemDriverBindingKind`](#filesystemdriverbindingkind) · [`FilesystemDriverCapabilities`](#filesystemdrivercapabilities) · [`FilesystemDriverCoverage`](#filesystemdrivercoverage) · [`FilesystemDriverDerivation`](#filesystemdriverderivation) · [`FilesystemDriverProfile`](#filesystemdriverprofile) · [`FilesystemDriverReadinessLayer`](#filesystemdriverreadinesslayer) · [`FilesystemDriverReadinessReport`](#filesystemdriverreadinessreport) · [`FilesystemDriverTarget`](#filesystemdrivertarget) · [`FilesystemMetadataPatch`](#filesystemmetadatapatch) · [`FilesystemMutationModel`](#filesystemmutationmodel) · [`FilesystemNodeId`](#filesystemnodeid) · [`FilesystemNodeInfo`](#filesystemnodeinfo) · [`FilesystemNodeKind`](#filesystemnodekind) · [`FilesystemOpenOptions`](#filesystemopenoptions) · [`FilesystemOptimization`](#filesystemoptimization) · [`FilesystemOptimizationAdapters`](#filesystemoptimizationadapters) · [`FilesystemOptimizationAdapters.HardLinkDeduplicator`](#filesystemoptimizationadaptershardlinkdeduplicator) · [`FilesystemOptimizationAdapters.SymbolicLinkDeduplicator`](#filesystemoptimizationadapterssymboliclinkdeduplicator) · [`FilesystemOptimizationExtensions`](#filesystemoptimizationextensions) · [`FilesystemOptimizationFeatures`](#filesystemoptimizationfeatures) · [`FilesystemOptimizationOptions`](#filesystemoptimizationoptions) · [`FilesystemSchemaPresets`](#filesystemschemapresets) · [`FilesystemSnapshotDirectoryEntry`](#filesystemsnapshotdirectoryentry) · [`FilesystemSnapshotNode`](#filesystemsnapshotnode) · [`FormatCapabilities`](#formatcapabilities) · [`FormatCategory`](#formatcategory) · [`FormatCreateOptions`](#formatcreateoptions) · [`FormatDetectionSignature`](#formatdetectionsignature) · [`FormatHeaderMatch`](#formatheadermatch) · [`FormatHealth`](#formathealth) · [`FormatHelpers`](#formathelpers) · [`FormatMethodInfo`](#formatmethodinfo) · [`FormatOptionDescriptor`](#formatoptiondescriptor) · [`FormatOptionKeys`](#formatoptionkeys) · [`FormatOptionKind`](#formatoptionkind) · [`FormatRegistry`](#formatregistry) · [`HardLinkDeduplicationSemantics`](#hardlinkdeduplicationsemantics) · [`IArchiveCreatable`](#iarchivecreatable) · [`IArchiveDefragmentable`](#iarchivedefragmentable) · [`IArchiveFormatOperations`](#iarchiveformatoperations) · [`IArchiveInMemoryExtract`](#iarchiveinmemoryextract) · [`IArchiveLayoutMap`](#iarchivelayoutmap) · [`IArchiveModifiable`](#iarchivemodifiable) · [`IArchivePurgeable`](#iarchivepurgeable) · [`IArchiveShrinkable`](#iarchiveshrinkable) · [`IArchiveWriteConstraints`](#iarchivewriteconstraints) · [`IAsyncArchiveOperations`](#iasyncarchiveoperations) · [`IAudioContainerFormat`](#iaudiocontainerformat) · [`IAudioDemuxSource`](#iaudiodemuxsource) · [`IAudioMuxTarget`](#iaudiomuxtarget) · [`IAudioPcmSource`](#iaudiopcmsource) · [`IAudioPcmTarget`](#iaudiopcmtarget) · [`IBlockDeviceFilesystemDriverProvider`](#iblockdevicefilesystemdriverprovider) · [`IBlockDeviceProvider`](#iblockdeviceprovider) · [`IBuildingBlock`](#ibuildingblock) · [`IContainerRemuxable`](#icontainerremuxable) · [`IFileInternalChunkMover`](#ifileinternalchunkmover) · [`IFileInternalLayoutMap`](#ifileinternallayoutmap) · [`IFilesystemBlockMover`](#ifilesystemblockmover) · [`IFilesystemDriverAdapter`](#ifilesystemdriveradapter) · [`IFilesystemDriverProvider`](#ifilesystemdriverprovider) · [`IFilesystemDriverReadinessProvider`](#ifilesystemdriverreadinessprovider) · [`IFilesystemExtentMap`](#ifilesystemextentmap) · [`IFilesystemFileHandle`](#ifilesystemfilehandle) · [`IFilesystemMetadataMover`](#ifilesystemmetadatamover) · [`IFilesystemPlaceable`](#ifilesystemplaceable) · [`IFilesystemScrambleable`](#ifilesystemscrambleable) · [`IFilesystemSession`](#ifilesystemsession) · [`IFilesystemTransaction`](#ifilesystemtransaction) · [`IFormatDescriptor`](#iformatdescriptor) · [`IFormatDetectionSource`](#iformatdetectionsource) · [`IFormatOptionsSchema`](#iformatoptionsschema) · [`IFormatValidator`](#iformatvalidator) · [`ILayoutOptimizable`](#ilayoutoptimizable) · [`IPartitionEditable`](#ipartitioneditable) · [`IRandomAccessBlockDevice`](#irandomaccessblockdevice) · [`IRandomAccessBlockDeviceProvider`](#irandomaccessblockdeviceprovider) · [`IRawTrackDevice`](#irawtrackdevice) · [`IRawTrackDeviceProvider`](#irawtrackdeviceprovider) · [`IStreamFormatOperations`](#istreamformatoperations) · [`ISymbolicLinkDeduplicationLayout`](#isymboliclinkdeduplicationlayout) · [`ISyntheticEntryNames`](#isyntheticentrynames) · [`IWipeEmpty`](#iwipeempty) · [`InnerFsDetector`](#innerfsdetector) · [`IssueSeverity`](#issueseverity) · [`LayoutAnalysis`](#layoutanalysis) · [`LayoutPatch`](#layoutpatch) · [`LayoutProfile`](#layoutprofile) · [`LayoutRebuildOptions`](#layoutrebuildoptions) · [`LayoutReclaim`](#layoutreclaim) · [`MagicSignature`](#magicsignature) · [`MediaProfile`](#mediaprofile) · [`MediaProfileLookup`](#mediaprofilelookup) · [`MetadataPlacementProfile`](#metadataplacementprofile) · [`MetadataPlacementRule`](#metadataplacementrule) · [`MetadataZone`](#metadatazone) · [`MethodNameParser`](#methodnameparser) · [`ModifyRebuilder`](#modifyrebuilder) · [`MutableRebuildFilesystemSession`](#mutablerebuildfilesystemsession) · [`MutableRebuildFilesystemSession.RebuildImage`](#mutablerebuildfilesystemsessionrebuildimage) · [`MutableRebuildFilesystemSession.ValidateImage`](#mutablerebuildfilesystemsessionvalidateimage) · [`PartitionBlockDevice`](#partitionblockdevice) · [`PlacementOptions`](#placementoptions) · [`PlacementZone`](#placementzone) · [`RawDiskShrinkRebuilder`](#rawdiskshrinkrebuilder) · [`RawTrackInfo`](#rawtrackinfo) · [`ReadOnlyFilesystemSnapshotSession`](#readonlyfilesystemsnapshotsession) · [`RebuildFilesystemEntry`](#rebuildfilesystementry) · [`RebuildVerb`](#rebuildverb) · [`ScrambleOptions`](#scrambleoptions) · [`SpoolingReadOnlyFileHandle`](#spoolingreadonlyfilehandle) · [`StreamBlockDevice`](#streamblockdevice) · [`SymlinkResolver`](#symlinkresolver) · [`UnusedSpaceWiper`](#unusedspacewiper) · [`ValidationIssue`](#validationissue) · [`ValidationLevel`](#validationlevel) · [`ValidationResult`](#validationresult) · [`WholeImageRebuildCommitter`](#wholeimagerebuildcommitter) #### `AlgorithmFamily` @@ -6408,6 +6408,24 @@ Implements `IEquatable`. | `OriginalSize` | `long OriginalSize { get; init; }` | The entry's own uncompressed on-disk size. For a symbolic link this is the byte length of the stored target path (the on-disk truth), NOT the size of whatever the link points at — see `TargetSize` for the resolved target size. | | `TargetSize` | `long? TargetSize { get; init; }` | The size of the file the link ultimately resolves to, when it points at a regular file within the same filesystem listing; null when unresolved (absolute target, target outside the listing, a directory target, or a dangling/cyclic link). Filled by `SymlinkResolver`. | +#### `ArchiveFormatOperationsExtensions` + +Makes the default archive input-mode members available when a descriptor is referenced by its concrete type. Default interface members are otherwise only in the member set of an `IArchiveFormatOperations` reference. + +| Member | Signature | Summary | +| --- | --- | --- | +| `ExtractEntryToMemorySpan` | `static byte[] ExtractEntryToMemorySpan(this IArchiveFormatOperations operations, ReadOnlySpan archive, string entryName, string password)` | Extracts one entry from an in-memory archive image into a new byte array. | +| `ExtractEntryToMemoryStreaming` | `static byte[] ExtractEntryToMemoryStreaming(this IArchiveFormatOperations operations, Stream archive, string entryName, string password)` | Extracts one entry from a forward-only or seekable archive source into memory. | +| `ExtractSeekable` | `static void ExtractSeekable(this IArchiveFormatOperations operations, Stream archive, string outputDir, string password, string[] files)` | Extracts entries through the explicit seek-based path. The supplied stream must support seeking; it is rewound before the descriptor's native reader is invoked. | +| `ExtractSpan` | `static void ExtractSpan(this IArchiveFormatOperations operations, ReadOnlySpan archive, string outputDir, string password, string[] files)` | Extracts entries from an in-memory archive image. Native span parsers can override this method to avoid the compatibility copy used by the default implementation. | +| `ExtractStreaming` | `static void ExtractStreaming(this IArchiveFormatOperations operations, Stream archive, string outputDir, string password, string[] files)` | Extracts entries from a forward-only or seekable stream. Descriptors with a native one-pass parser should override this method; the default spools only when necessary. | +| `ListSeekable` | `static List ListSeekable(this IArchiveFormatOperations operations, Stream archive, string password)` | Lists entries through the explicit seek-based path. The supplied stream must support seeking; it is rewound before the descriptor's native reader is invoked. | +| `ListSpan` | `static List ListSpan(this IArchiveFormatOperations operations, ReadOnlySpan archive, string password)` | Lists entries from an in-memory archive image. The default compatibility bridge copies the span once because a `Stream` cannot safely retain a borrowed span; native span parsers should override this method to remain allocation-free. | +| `ListStreaming` | `static List ListStreaming(this IArchiveFormatOperations operations, Stream archive, string password)` | Lists entries from a forward-only or seekable stream. This is the libarchive-style streaming entry point: callers do not need to provide seek capability. | +| `OpenEntrySeekable` | `static Stream OpenEntrySeekable(this IArchiveFormatOperations operations, Stream archive, string entryName, string password)` | Opens one entry through the explicit seek-based path. The archive is rewound before the descriptor-specific entry reader is invoked. | +| `OpenEntrySpan` | `static Stream OpenEntrySpan(this IArchiveFormatOperations operations, ReadOnlySpan archive, string entryName, string password)` | Opens one entry from an in-memory archive image. Because the returned stream may outlive this call, the default bridge owns one copy of the supplied span until that stream is disposed. Native span readers can override this method when they can return independently owned output. | +| `OpenEntryStreaming` | `static Stream OpenEntryStreaming(this IArchiveFormatOperations operations, Stream archive, string entryName, string password)` | Opens one entry from a forward-only or seekable archive source. A temporary spool, when required, stays alive until the returned entry stream is disposed. | + #### `ArchiveInputInfo` Describes a single input file/directory for archive creation. @@ -7363,9 +7381,20 @@ The base capability every archive descriptor implements: list entries and extrac | Member | Signature | Summary | | --- | --- | --- | +| `ExtractEntryToMemorySpan` | `byte[] ExtractEntryToMemorySpan(ReadOnlySpan archive, string entryName, string password)` | Extracts one entry from an in-memory archive image into a new byte array. | +| `ExtractEntryToMemoryStreaming` | `byte[] ExtractEntryToMemoryStreaming(Stream archive, string entryName, string password)` | Extracts one entry from a forward-only or seekable archive source into memory. | | `ExtractEntryToMemory` | `byte[] ExtractEntryToMemory(Stream archive, string entryName, string password)` | Extracts a single entry to a byte array. This is the explicitly buffered convenience API; callers working with large entries should use `OpenEntry` instead. | -| `Extract` | `void Extract(Stream stream, string outputDir, string password, string[] files)` | Extract entries from the archive to an output directory. | -| `List` | `List List(Stream stream, string password)` | List all entries in the archive. | +| `ExtractSeekable` | `void ExtractSeekable(Stream archive, string outputDir, string password, string[] files)` | Extracts entries through the explicit seek-based path. The supplied stream must support seeking; it is rewound before the descriptor's native reader is invoked. | +| `ExtractSpan` | `void ExtractSpan(ReadOnlySpan archive, string outputDir, string password, string[] files)` | Extracts entries from an in-memory archive image. Native span parsers can override this method to avoid the compatibility copy used by the default implementation. | +| `ExtractStreaming` | `void ExtractStreaming(Stream archive, string outputDir, string password, string[] files)` | Extracts entries from a forward-only or seekable stream. Descriptors with a native one-pass parser should override this method; the default spools only when necessary. | +| `Extract` | `void Extract(Stream stream, string outputDir, string password, string[] files)` | Extract entries from the archive to an output directory using the descriptor's native stream path. | +| `ListSeekable` | `List ListSeekable(Stream archive, string password)` | Lists entries through the explicit seek-based path. The supplied stream must support seeking; it is rewound before the descriptor's native reader is invoked. | +| `ListSpan` | `List ListSpan(ReadOnlySpan archive, string password)` | Lists entries from an in-memory archive image. The default compatibility bridge copies the span once because a `Stream` cannot safely retain a borrowed span; native span parsers should override this method to remain allocation-free. | +| `ListStreaming` | `List ListStreaming(Stream archive, string password)` | Lists entries from a forward-only or seekable stream. This is the libarchive-style streaming entry point: callers do not need to provide seek capability. | +| `List` | `List List(Stream stream, string password)` | List all entries in the archive using the descriptor's native stream path. | +| `OpenEntrySeekable` | `Stream OpenEntrySeekable(Stream archive, string entryName, string password)` | Opens one entry through the explicit seek-based path. The archive is rewound before the descriptor-specific entry reader is invoked. | +| `OpenEntrySpan` | `Stream OpenEntrySpan(ReadOnlySpan archive, string entryName, string password)` | Opens one entry from an in-memory archive image. Because the returned stream may outlive this call, the default bridge owns one copy of the supplied span until that stream is disposed. Native span readers can override this method when they can return independently owned output. | +| `OpenEntryStreaming` | `Stream OpenEntryStreaming(Stream archive, string entryName, string password)` | Opens one entry from a forward-only or seekable archive source. A temporary spool, when required, stays alive until the returned entry stream is disposed. | | `OpenEntry` | `Stream OpenEntry(Stream archive, string entryName, string password)` | Opens a single entry as a read-only `Stream` bounded to that entry's logical bytes — physically incapable of reading slack space, adjacent entries, padding/alignment fillers, or header/metadata regions. This is the canonical per-entry isolation primitive used by streaming conversion and derived-filesystem pipelines. | #### `IArchiveInMemoryExtract` diff --git a/Hawkynt.FileFormats.Archives/README.md b/Hawkynt.FileFormats.Archives/README.md index feae9d968..9b36fc714 100644 --- a/Hawkynt.FileFormats.Archives/README.md +++ b/Hawkynt.FileFormats.Archives/README.md @@ -534,7 +534,7 @@ Use it when a .NET process needs to enumerate, extract, test, create, edit or in -Every public and protected member of all 2536 types, generated from the built assembly and its XML documentation, is in [REFERENCE.md](https://github.com/Hawkynt/CompressionWorkbench/blob/main/Hawkynt.FileFormats.Archives/REFERENCE.md). +Every public and protected member of all 2537 types, generated from the built assembly and its XML documentation, is in [REFERENCE.md](https://github.com/Hawkynt/CompressionWorkbench/blob/main/Hawkynt.FileFormats.Archives/REFERENCE.md). diff --git a/Hawkynt.FileFormats.Archives/REFERENCE.md b/Hawkynt.FileFormats.Archives/REFERENCE.md index 169d74617..953618a46 100644 --- a/Hawkynt.FileFormats.Archives/REFERENCE.md +++ b/Hawkynt.FileFormats.Archives/REFERENCE.md @@ -3816,7 +3816,7 @@ The memory and I/O abstraction the `Cpu` core talks to. Every memory fetch, read ### Namespace `Compression.Registry` -[`AlgorithmFamily`](#algorithmfamily) · [`ApeTagReader`](#apetagreader) · [`ApeTagReader.ApeTag`](#apetagreaderapetag) · [`ArchiveEntryInfo`](#archiveentryinfo) · [`ArchiveInputInfo`](#archiveinputinfo) · [`ArchiveMutationOptions`](#archivemutationoptions) · [`ArchiveShrinker`](#archiveshrinker) · [`AudioEncodedStream`](#audioencodedstream) · [`AudioPacket`](#audiopacket) · [`AudioPcmBuffer`](#audiopcmbuffer) · [`AudioPcmEncoding`](#audiopcmencoding) · [`AudioPcmFormat`](#audiopcmformat) · [`AudioPseudoArchive`](#audiopseudoarchive) · [`AudioPseudoArchive.Entry`](#audiopseudoarchiveentry) · [`AudioStreamFormat`](#audiostreamformat) · [`BlockDeviceGeometry`](#blockdevicegeometry) · [`BlockDeviceStream`](#blockdevicestream) · [`BuildingBlockRegistry`](#buildingblockregistry) · [`CompoundTarDescriptor`](#compoundtardescriptor) · [`DefragBlockClass`](#defragblockclass) · [`DefragBlockInfo`](#defragblockinfo) · [`DefragBlockKind`](#defragblockkind) · [`DefragContentGuard`](#defragcontentguard) · [`DefragMode`](#defragmode) · [`DefragOptions`](#defragoptions) · [`DefragProgressEvent`](#defragprogressevent) · [`DefragRebuilder`](#defragrebuilder) · [`EntropyDetector`](#entropydetector) · [`FatDirStamp`](#fatdirstamp) · [`FilesystemAllocationMapCompleter`](#filesystemallocationmapcompleter) · [`FilesystemCompressionParameter`](#filesystemcompressionparameter) · [`FilesystemCompressionProfile`](#filesystemcompressionprofile) · [`FilesystemDirectoryEntry`](#filesystemdirectoryentry) · [`FilesystemDriverBindingKind`](#filesystemdriverbindingkind) · [`FilesystemDriverCapabilities`](#filesystemdrivercapabilities) · [`FilesystemDriverCoverage`](#filesystemdrivercoverage) · [`FilesystemDriverDerivation`](#filesystemdriverderivation) · [`FilesystemDriverProfile`](#filesystemdriverprofile) · [`FilesystemDriverReadinessLayer`](#filesystemdriverreadinesslayer) · [`FilesystemDriverReadinessReport`](#filesystemdriverreadinessreport) · [`FilesystemDriverTarget`](#filesystemdrivertarget) · [`FilesystemMetadataPatch`](#filesystemmetadatapatch) · [`FilesystemMutationModel`](#filesystemmutationmodel) · [`FilesystemNodeId`](#filesystemnodeid) · [`FilesystemNodeInfo`](#filesystemnodeinfo) · [`FilesystemNodeKind`](#filesystemnodekind) · [`FilesystemOpenOptions`](#filesystemopenoptions) · [`FilesystemOptimization`](#filesystemoptimization) · [`FilesystemOptimizationAdapters`](#filesystemoptimizationadapters) · [`FilesystemOptimizationAdapters.HardLinkDeduplicator`](#filesystemoptimizationadaptershardlinkdeduplicator) · [`FilesystemOptimizationAdapters.SymbolicLinkDeduplicator`](#filesystemoptimizationadapterssymboliclinkdeduplicator) · [`FilesystemOptimizationExtensions`](#filesystemoptimizationextensions) · [`FilesystemOptimizationFeatures`](#filesystemoptimizationfeatures) · [`FilesystemOptimizationOptions`](#filesystemoptimizationoptions) · [`FilesystemSchemaPresets`](#filesystemschemapresets) · [`FilesystemSnapshotDirectoryEntry`](#filesystemsnapshotdirectoryentry) · [`FilesystemSnapshotNode`](#filesystemsnapshotnode) · [`FormatCapabilities`](#formatcapabilities) · [`FormatCategory`](#formatcategory) · [`FormatCreateOptions`](#formatcreateoptions) · [`FormatDetectionSignature`](#formatdetectionsignature) · [`FormatHeaderMatch`](#formatheadermatch) · [`FormatHealth`](#formathealth) · [`FormatHelpers`](#formathelpers) · [`FormatMethodInfo`](#formatmethodinfo) · [`FormatOptionDescriptor`](#formatoptiondescriptor) · [`FormatOptionKeys`](#formatoptionkeys) · [`FormatOptionKind`](#formatoptionkind) · [`FormatRegistry`](#formatregistry) · [`HardLinkDeduplicationSemantics`](#hardlinkdeduplicationsemantics) · [`IArchiveCreatable`](#iarchivecreatable) · [`IArchiveDefragmentable`](#iarchivedefragmentable) · [`IArchiveFormatOperations`](#iarchiveformatoperations) · [`IArchiveInMemoryExtract`](#iarchiveinmemoryextract) · [`IArchiveLayoutMap`](#iarchivelayoutmap) · [`IArchiveModifiable`](#iarchivemodifiable) · [`IArchivePurgeable`](#iarchivepurgeable) · [`IArchiveShrinkable`](#iarchiveshrinkable) · [`IArchiveWriteConstraints`](#iarchivewriteconstraints) · [`IAsyncArchiveOperations`](#iasyncarchiveoperations) · [`IAudioContainerFormat`](#iaudiocontainerformat) · [`IAudioDemuxSource`](#iaudiodemuxsource) · [`IAudioMuxTarget`](#iaudiomuxtarget) · [`IAudioPcmSource`](#iaudiopcmsource) · [`IAudioPcmTarget`](#iaudiopcmtarget) · [`IBlockDeviceFilesystemDriverProvider`](#iblockdevicefilesystemdriverprovider) · [`IBlockDeviceProvider`](#iblockdeviceprovider) · [`IBuildingBlock`](#ibuildingblock) · [`IContainerRemuxable`](#icontainerremuxable) · [`IFileInternalChunkMover`](#ifileinternalchunkmover) · [`IFileInternalLayoutMap`](#ifileinternallayoutmap) · [`IFilesystemBlockMover`](#ifilesystemblockmover) · [`IFilesystemDriverAdapter`](#ifilesystemdriveradapter) · [`IFilesystemDriverProvider`](#ifilesystemdriverprovider) · [`IFilesystemDriverReadinessProvider`](#ifilesystemdriverreadinessprovider) · [`IFilesystemExtentMap`](#ifilesystemextentmap) · [`IFilesystemFileHandle`](#ifilesystemfilehandle) · [`IFilesystemMetadataMover`](#ifilesystemmetadatamover) · [`IFilesystemPlaceable`](#ifilesystemplaceable) · [`IFilesystemScrambleable`](#ifilesystemscrambleable) · [`IFilesystemSession`](#ifilesystemsession) · [`IFilesystemTransaction`](#ifilesystemtransaction) · [`IFormatDescriptor`](#iformatdescriptor) · [`IFormatDetectionSource`](#iformatdetectionsource) · [`IFormatOptionsSchema`](#iformatoptionsschema) · [`IFormatValidator`](#iformatvalidator) · [`ILayoutOptimizable`](#ilayoutoptimizable) · [`IPartitionEditable`](#ipartitioneditable) · [`IRandomAccessBlockDevice`](#irandomaccessblockdevice) · [`IRandomAccessBlockDeviceProvider`](#irandomaccessblockdeviceprovider) · [`IRawTrackDevice`](#irawtrackdevice) · [`IRawTrackDeviceProvider`](#irawtrackdeviceprovider) · [`IStreamFormatOperations`](#istreamformatoperations) · [`ISymbolicLinkDeduplicationLayout`](#isymboliclinkdeduplicationlayout) · [`ISyntheticEntryNames`](#isyntheticentrynames) · [`IWipeEmpty`](#iwipeempty) · [`InnerFsDetector`](#innerfsdetector) · [`IssueSeverity`](#issueseverity) · [`LayoutAnalysis`](#layoutanalysis) · [`LayoutPatch`](#layoutpatch) · [`LayoutProfile`](#layoutprofile) · [`LayoutRebuildOptions`](#layoutrebuildoptions) · [`LayoutReclaim`](#layoutreclaim) · [`MagicSignature`](#magicsignature) · [`MediaProfile`](#mediaprofile) · [`MediaProfileLookup`](#mediaprofilelookup) · [`MetadataPlacementProfile`](#metadataplacementprofile) · [`MetadataPlacementRule`](#metadataplacementrule) · [`MetadataZone`](#metadatazone) · [`MethodNameParser`](#methodnameparser) · [`ModifyRebuilder`](#modifyrebuilder) · [`MutableRebuildFilesystemSession`](#mutablerebuildfilesystemsession) · [`MutableRebuildFilesystemSession.RebuildImage`](#mutablerebuildfilesystemsessionrebuildimage) · [`MutableRebuildFilesystemSession.ValidateImage`](#mutablerebuildfilesystemsessionvalidateimage) · [`PartitionBlockDevice`](#partitionblockdevice) · [`PlacementOptions`](#placementoptions) · [`PlacementZone`](#placementzone) · [`RawDiskShrinkRebuilder`](#rawdiskshrinkrebuilder) · [`RawTrackInfo`](#rawtrackinfo) · [`ReadOnlyFilesystemSnapshotSession`](#readonlyfilesystemsnapshotsession) · [`RebuildFilesystemEntry`](#rebuildfilesystementry) · [`RebuildVerb`](#rebuildverb) · [`ScrambleOptions`](#scrambleoptions) · [`SpoolingReadOnlyFileHandle`](#spoolingreadonlyfilehandle) · [`StreamBlockDevice`](#streamblockdevice) · [`SymlinkResolver`](#symlinkresolver) · [`UnusedSpaceWiper`](#unusedspacewiper) · [`ValidationIssue`](#validationissue) · [`ValidationLevel`](#validationlevel) · [`ValidationResult`](#validationresult) · [`WholeImageRebuildCommitter`](#wholeimagerebuildcommitter) +[`AlgorithmFamily`](#algorithmfamily) · [`ApeTagReader`](#apetagreader) · [`ApeTagReader.ApeTag`](#apetagreaderapetag) · [`ArchiveEntryInfo`](#archiveentryinfo) · [`ArchiveFormatOperationsExtensions`](#archiveformatoperationsextensions) · [`ArchiveInputInfo`](#archiveinputinfo) · [`ArchiveMutationOptions`](#archivemutationoptions) · [`ArchiveShrinker`](#archiveshrinker) · [`AudioEncodedStream`](#audioencodedstream) · [`AudioPacket`](#audiopacket) · [`AudioPcmBuffer`](#audiopcmbuffer) · [`AudioPcmEncoding`](#audiopcmencoding) · [`AudioPcmFormat`](#audiopcmformat) · [`AudioPseudoArchive`](#audiopseudoarchive) · [`AudioPseudoArchive.Entry`](#audiopseudoarchiveentry) · [`AudioStreamFormat`](#audiostreamformat) · [`BlockDeviceGeometry`](#blockdevicegeometry) · [`BlockDeviceStream`](#blockdevicestream) · [`BuildingBlockRegistry`](#buildingblockregistry) · [`CompoundTarDescriptor`](#compoundtardescriptor) · [`DefragBlockClass`](#defragblockclass) · [`DefragBlockInfo`](#defragblockinfo) · [`DefragBlockKind`](#defragblockkind) · [`DefragContentGuard`](#defragcontentguard) · [`DefragMode`](#defragmode) · [`DefragOptions`](#defragoptions) · [`DefragProgressEvent`](#defragprogressevent) · [`DefragRebuilder`](#defragrebuilder) · [`EntropyDetector`](#entropydetector) · [`FatDirStamp`](#fatdirstamp) · [`FilesystemAllocationMapCompleter`](#filesystemallocationmapcompleter) · [`FilesystemCompressionParameter`](#filesystemcompressionparameter) · [`FilesystemCompressionProfile`](#filesystemcompressionprofile) · [`FilesystemDirectoryEntry`](#filesystemdirectoryentry) · [`FilesystemDriverBindingKind`](#filesystemdriverbindingkind) · [`FilesystemDriverCapabilities`](#filesystemdrivercapabilities) · [`FilesystemDriverCoverage`](#filesystemdrivercoverage) · [`FilesystemDriverDerivation`](#filesystemdriverderivation) · [`FilesystemDriverProfile`](#filesystemdriverprofile) · [`FilesystemDriverReadinessLayer`](#filesystemdriverreadinesslayer) · [`FilesystemDriverReadinessReport`](#filesystemdriverreadinessreport) · [`FilesystemDriverTarget`](#filesystemdrivertarget) · [`FilesystemMetadataPatch`](#filesystemmetadatapatch) · [`FilesystemMutationModel`](#filesystemmutationmodel) · [`FilesystemNodeId`](#filesystemnodeid) · [`FilesystemNodeInfo`](#filesystemnodeinfo) · [`FilesystemNodeKind`](#filesystemnodekind) · [`FilesystemOpenOptions`](#filesystemopenoptions) · [`FilesystemOptimization`](#filesystemoptimization) · [`FilesystemOptimizationAdapters`](#filesystemoptimizationadapters) · [`FilesystemOptimizationAdapters.HardLinkDeduplicator`](#filesystemoptimizationadaptershardlinkdeduplicator) · [`FilesystemOptimizationAdapters.SymbolicLinkDeduplicator`](#filesystemoptimizationadapterssymboliclinkdeduplicator) · [`FilesystemOptimizationExtensions`](#filesystemoptimizationextensions) · [`FilesystemOptimizationFeatures`](#filesystemoptimizationfeatures) · [`FilesystemOptimizationOptions`](#filesystemoptimizationoptions) · [`FilesystemSchemaPresets`](#filesystemschemapresets) · [`FilesystemSnapshotDirectoryEntry`](#filesystemsnapshotdirectoryentry) · [`FilesystemSnapshotNode`](#filesystemsnapshotnode) · [`FormatCapabilities`](#formatcapabilities) · [`FormatCategory`](#formatcategory) · [`FormatCreateOptions`](#formatcreateoptions) · [`FormatDetectionSignature`](#formatdetectionsignature) · [`FormatHeaderMatch`](#formatheadermatch) · [`FormatHealth`](#formathealth) · [`FormatHelpers`](#formathelpers) · [`FormatMethodInfo`](#formatmethodinfo) · [`FormatOptionDescriptor`](#formatoptiondescriptor) · [`FormatOptionKeys`](#formatoptionkeys) · [`FormatOptionKind`](#formatoptionkind) · [`FormatRegistry`](#formatregistry) · [`HardLinkDeduplicationSemantics`](#hardlinkdeduplicationsemantics) · [`IArchiveCreatable`](#iarchivecreatable) · [`IArchiveDefragmentable`](#iarchivedefragmentable) · [`IArchiveFormatOperations`](#iarchiveformatoperations) · [`IArchiveInMemoryExtract`](#iarchiveinmemoryextract) · [`IArchiveLayoutMap`](#iarchivelayoutmap) · [`IArchiveModifiable`](#iarchivemodifiable) · [`IArchivePurgeable`](#iarchivepurgeable) · [`IArchiveShrinkable`](#iarchiveshrinkable) · [`IArchiveWriteConstraints`](#iarchivewriteconstraints) · [`IAsyncArchiveOperations`](#iasyncarchiveoperations) · [`IAudioContainerFormat`](#iaudiocontainerformat) · [`IAudioDemuxSource`](#iaudiodemuxsource) · [`IAudioMuxTarget`](#iaudiomuxtarget) · [`IAudioPcmSource`](#iaudiopcmsource) · [`IAudioPcmTarget`](#iaudiopcmtarget) · [`IBlockDeviceFilesystemDriverProvider`](#iblockdevicefilesystemdriverprovider) · [`IBlockDeviceProvider`](#iblockdeviceprovider) · [`IBuildingBlock`](#ibuildingblock) · [`IContainerRemuxable`](#icontainerremuxable) · [`IFileInternalChunkMover`](#ifileinternalchunkmover) · [`IFileInternalLayoutMap`](#ifileinternallayoutmap) · [`IFilesystemBlockMover`](#ifilesystemblockmover) · [`IFilesystemDriverAdapter`](#ifilesystemdriveradapter) · [`IFilesystemDriverProvider`](#ifilesystemdriverprovider) · [`IFilesystemDriverReadinessProvider`](#ifilesystemdriverreadinessprovider) · [`IFilesystemExtentMap`](#ifilesystemextentmap) · [`IFilesystemFileHandle`](#ifilesystemfilehandle) · [`IFilesystemMetadataMover`](#ifilesystemmetadatamover) · [`IFilesystemPlaceable`](#ifilesystemplaceable) · [`IFilesystemScrambleable`](#ifilesystemscrambleable) · [`IFilesystemSession`](#ifilesystemsession) · [`IFilesystemTransaction`](#ifilesystemtransaction) · [`IFormatDescriptor`](#iformatdescriptor) · [`IFormatDetectionSource`](#iformatdetectionsource) · [`IFormatOptionsSchema`](#iformatoptionsschema) · [`IFormatValidator`](#iformatvalidator) · [`ILayoutOptimizable`](#ilayoutoptimizable) · [`IPartitionEditable`](#ipartitioneditable) · [`IRandomAccessBlockDevice`](#irandomaccessblockdevice) · [`IRandomAccessBlockDeviceProvider`](#irandomaccessblockdeviceprovider) · [`IRawTrackDevice`](#irawtrackdevice) · [`IRawTrackDeviceProvider`](#irawtrackdeviceprovider) · [`IStreamFormatOperations`](#istreamformatoperations) · [`ISymbolicLinkDeduplicationLayout`](#isymboliclinkdeduplicationlayout) · [`ISyntheticEntryNames`](#isyntheticentrynames) · [`IWipeEmpty`](#iwipeempty) · [`InnerFsDetector`](#innerfsdetector) · [`IssueSeverity`](#issueseverity) · [`LayoutAnalysis`](#layoutanalysis) · [`LayoutPatch`](#layoutpatch) · [`LayoutProfile`](#layoutprofile) · [`LayoutRebuildOptions`](#layoutrebuildoptions) · [`LayoutReclaim`](#layoutreclaim) · [`MagicSignature`](#magicsignature) · [`MediaProfile`](#mediaprofile) · [`MediaProfileLookup`](#mediaprofilelookup) · [`MetadataPlacementProfile`](#metadataplacementprofile) · [`MetadataPlacementRule`](#metadataplacementrule) · [`MetadataZone`](#metadatazone) · [`MethodNameParser`](#methodnameparser) · [`ModifyRebuilder`](#modifyrebuilder) · [`MutableRebuildFilesystemSession`](#mutablerebuildfilesystemsession) · [`MutableRebuildFilesystemSession.RebuildImage`](#mutablerebuildfilesystemsessionrebuildimage) · [`MutableRebuildFilesystemSession.ValidateImage`](#mutablerebuildfilesystemsessionvalidateimage) · [`PartitionBlockDevice`](#partitionblockdevice) · [`PlacementOptions`](#placementoptions) · [`PlacementZone`](#placementzone) · [`RawDiskShrinkRebuilder`](#rawdiskshrinkrebuilder) · [`RawTrackInfo`](#rawtrackinfo) · [`ReadOnlyFilesystemSnapshotSession`](#readonlyfilesystemsnapshotsession) · [`RebuildFilesystemEntry`](#rebuildfilesystementry) · [`RebuildVerb`](#rebuildverb) · [`ScrambleOptions`](#scrambleoptions) · [`SpoolingReadOnlyFileHandle`](#spoolingreadonlyfilehandle) · [`StreamBlockDevice`](#streamblockdevice) · [`SymlinkResolver`](#symlinkresolver) · [`UnusedSpaceWiper`](#unusedspacewiper) · [`ValidationIssue`](#validationissue) · [`ValidationLevel`](#validationlevel) · [`ValidationResult`](#validationresult) · [`WholeImageRebuildCommitter`](#wholeimagerebuildcommitter) #### `AlgorithmFamily` @@ -3885,6 +3885,24 @@ Implements `IEquatable`. | `OriginalSize` | `long OriginalSize { get; init; }` | The entry's own uncompressed on-disk size. For a symbolic link this is the byte length of the stored target path (the on-disk truth), NOT the size of whatever the link points at — see `TargetSize` for the resolved target size. | | `TargetSize` | `long? TargetSize { get; init; }` | The size of the file the link ultimately resolves to, when it points at a regular file within the same filesystem listing; null when unresolved (absolute target, target outside the listing, a directory target, or a dangling/cyclic link). Filled by `SymlinkResolver`. | +#### `ArchiveFormatOperationsExtensions` + +Makes the default archive input-mode members available when a descriptor is referenced by its concrete type. Default interface members are otherwise only in the member set of an `IArchiveFormatOperations` reference. + +| Member | Signature | Summary | +| --- | --- | --- | +| `ExtractEntryToMemorySpan` | `static byte[] ExtractEntryToMemorySpan(this IArchiveFormatOperations operations, ReadOnlySpan archive, string entryName, string password)` | Extracts one entry from an in-memory archive image into a new byte array. | +| `ExtractEntryToMemoryStreaming` | `static byte[] ExtractEntryToMemoryStreaming(this IArchiveFormatOperations operations, Stream archive, string entryName, string password)` | Extracts one entry from a forward-only or seekable archive source into memory. | +| `ExtractSeekable` | `static void ExtractSeekable(this IArchiveFormatOperations operations, Stream archive, string outputDir, string password, string[] files)` | Extracts entries through the explicit seek-based path. The supplied stream must support seeking; it is rewound before the descriptor's native reader is invoked. | +| `ExtractSpan` | `static void ExtractSpan(this IArchiveFormatOperations operations, ReadOnlySpan archive, string outputDir, string password, string[] files)` | Extracts entries from an in-memory archive image. Native span parsers can override this method to avoid the compatibility copy used by the default implementation. | +| `ExtractStreaming` | `static void ExtractStreaming(this IArchiveFormatOperations operations, Stream archive, string outputDir, string password, string[] files)` | Extracts entries from a forward-only or seekable stream. Descriptors with a native one-pass parser should override this method; the default spools only when necessary. | +| `ListSeekable` | `static List ListSeekable(this IArchiveFormatOperations operations, Stream archive, string password)` | Lists entries through the explicit seek-based path. The supplied stream must support seeking; it is rewound before the descriptor's native reader is invoked. | +| `ListSpan` | `static List ListSpan(this IArchiveFormatOperations operations, ReadOnlySpan archive, string password)` | Lists entries from an in-memory archive image. The default compatibility bridge copies the span once because a `Stream` cannot safely retain a borrowed span; native span parsers should override this method to remain allocation-free. | +| `ListStreaming` | `static List ListStreaming(this IArchiveFormatOperations operations, Stream archive, string password)` | Lists entries from a forward-only or seekable stream. This is the libarchive-style streaming entry point: callers do not need to provide seek capability. | +| `OpenEntrySeekable` | `static Stream OpenEntrySeekable(this IArchiveFormatOperations operations, Stream archive, string entryName, string password)` | Opens one entry through the explicit seek-based path. The archive is rewound before the descriptor-specific entry reader is invoked. | +| `OpenEntrySpan` | `static Stream OpenEntrySpan(this IArchiveFormatOperations operations, ReadOnlySpan archive, string entryName, string password)` | Opens one entry from an in-memory archive image. Because the returned stream may outlive this call, the default bridge owns one copy of the supplied span until that stream is disposed. Native span readers can override this method when they can return independently owned output. | +| `OpenEntryStreaming` | `static Stream OpenEntryStreaming(this IArchiveFormatOperations operations, Stream archive, string entryName, string password)` | Opens one entry from a forward-only or seekable archive source. A temporary spool, when required, stays alive until the returned entry stream is disposed. | + #### `ArchiveInputInfo` Describes a single input file/directory for archive creation. @@ -4840,9 +4858,20 @@ The base capability every archive descriptor implements: list entries and extrac | Member | Signature | Summary | | --- | --- | --- | +| `ExtractEntryToMemorySpan` | `byte[] ExtractEntryToMemorySpan(ReadOnlySpan archive, string entryName, string password)` | Extracts one entry from an in-memory archive image into a new byte array. | +| `ExtractEntryToMemoryStreaming` | `byte[] ExtractEntryToMemoryStreaming(Stream archive, string entryName, string password)` | Extracts one entry from a forward-only or seekable archive source into memory. | | `ExtractEntryToMemory` | `byte[] ExtractEntryToMemory(Stream archive, string entryName, string password)` | Extracts a single entry to a byte array. This is the explicitly buffered convenience API; callers working with large entries should use `OpenEntry` instead. | -| `Extract` | `void Extract(Stream stream, string outputDir, string password, string[] files)` | Extract entries from the archive to an output directory. | -| `List` | `List List(Stream stream, string password)` | List all entries in the archive. | +| `ExtractSeekable` | `void ExtractSeekable(Stream archive, string outputDir, string password, string[] files)` | Extracts entries through the explicit seek-based path. The supplied stream must support seeking; it is rewound before the descriptor's native reader is invoked. | +| `ExtractSpan` | `void ExtractSpan(ReadOnlySpan archive, string outputDir, string password, string[] files)` | Extracts entries from an in-memory archive image. Native span parsers can override this method to avoid the compatibility copy used by the default implementation. | +| `ExtractStreaming` | `void ExtractStreaming(Stream archive, string outputDir, string password, string[] files)` | Extracts entries from a forward-only or seekable stream. Descriptors with a native one-pass parser should override this method; the default spools only when necessary. | +| `Extract` | `void Extract(Stream stream, string outputDir, string password, string[] files)` | Extract entries from the archive to an output directory using the descriptor's native stream path. | +| `ListSeekable` | `List ListSeekable(Stream archive, string password)` | Lists entries through the explicit seek-based path. The supplied stream must support seeking; it is rewound before the descriptor's native reader is invoked. | +| `ListSpan` | `List ListSpan(ReadOnlySpan archive, string password)` | Lists entries from an in-memory archive image. The default compatibility bridge copies the span once because a `Stream` cannot safely retain a borrowed span; native span parsers should override this method to remain allocation-free. | +| `ListStreaming` | `List ListStreaming(Stream archive, string password)` | Lists entries from a forward-only or seekable stream. This is the libarchive-style streaming entry point: callers do not need to provide seek capability. | +| `List` | `List List(Stream stream, string password)` | List all entries in the archive using the descriptor's native stream path. | +| `OpenEntrySeekable` | `Stream OpenEntrySeekable(Stream archive, string entryName, string password)` | Opens one entry through the explicit seek-based path. The archive is rewound before the descriptor-specific entry reader is invoked. | +| `OpenEntrySpan` | `Stream OpenEntrySpan(ReadOnlySpan archive, string entryName, string password)` | Opens one entry from an in-memory archive image. Because the returned stream may outlive this call, the default bridge owns one copy of the supplied span until that stream is disposed. Native span readers can override this method when they can return independently owned output. | +| `OpenEntryStreaming` | `Stream OpenEntryStreaming(Stream archive, string entryName, string password)` | Opens one entry from a forward-only or seekable archive source. A temporary spool, when required, stays alive until the returned entry stream is disposed. | | `OpenEntry` | `Stream OpenEntry(Stream archive, string entryName, string password)` | Opens a single entry as a read-only `Stream` bounded to that entry's logical bytes — physically incapable of reading slack space, adjacent entries, padding/alignment fillers, or header/metadata regions. This is the canonical per-entry isolation primitive used by streaming conversion and derived-filesystem pipelines. | #### `IArchiveInMemoryExtract` diff --git a/Hawkynt.FileFormats.Audio/README.md b/Hawkynt.FileFormats.Audio/README.md index 30dfbaf9e..9a8c1c07e 100644 --- a/Hawkynt.FileFormats.Audio/README.md +++ b/Hawkynt.FileFormats.Audio/README.md @@ -390,7 +390,7 @@ The audio package is built against the repository's shared Core version and shou -Every public and protected member of all 1449 types, generated from the built assembly and its XML documentation, is in [REFERENCE.md](https://github.com/Hawkynt/CompressionWorkbench/blob/main/Hawkynt.FileFormats.Audio/REFERENCE.md). +Every public and protected member of all 1450 types, generated from the built assembly and its XML documentation, is in [REFERENCE.md](https://github.com/Hawkynt/CompressionWorkbench/blob/main/Hawkynt.FileFormats.Audio/REFERENCE.md). diff --git a/Hawkynt.FileFormats.Audio/REFERENCE.md b/Hawkynt.FileFormats.Audio/REFERENCE.md index 27860c742..e523cb2d7 100644 --- a/Hawkynt.FileFormats.Audio/REFERENCE.md +++ b/Hawkynt.FileFormats.Audio/REFERENCE.md @@ -3816,7 +3816,7 @@ The memory and I/O abstraction the `Cpu` core talks to. Every memory fetch, read ### Namespace `Compression.Registry` -[`AlgorithmFamily`](#algorithmfamily) · [`ApeTagReader`](#apetagreader) · [`ApeTagReader.ApeTag`](#apetagreaderapetag) · [`ArchiveEntryInfo`](#archiveentryinfo) · [`ArchiveInputInfo`](#archiveinputinfo) · [`ArchiveMutationOptions`](#archivemutationoptions) · [`ArchiveShrinker`](#archiveshrinker) · [`AudioEncodedStream`](#audioencodedstream) · [`AudioPacket`](#audiopacket) · [`AudioPcmBuffer`](#audiopcmbuffer) · [`AudioPcmEncoding`](#audiopcmencoding) · [`AudioPcmFormat`](#audiopcmformat) · [`AudioPseudoArchive`](#audiopseudoarchive) · [`AudioPseudoArchive.Entry`](#audiopseudoarchiveentry) · [`AudioStreamFormat`](#audiostreamformat) · [`BlockDeviceGeometry`](#blockdevicegeometry) · [`BlockDeviceStream`](#blockdevicestream) · [`BuildingBlockRegistry`](#buildingblockregistry) · [`CompoundTarDescriptor`](#compoundtardescriptor) · [`DefragBlockClass`](#defragblockclass) · [`DefragBlockInfo`](#defragblockinfo) · [`DefragBlockKind`](#defragblockkind) · [`DefragContentGuard`](#defragcontentguard) · [`DefragMode`](#defragmode) · [`DefragOptions`](#defragoptions) · [`DefragProgressEvent`](#defragprogressevent) · [`DefragRebuilder`](#defragrebuilder) · [`EntropyDetector`](#entropydetector) · [`FatDirStamp`](#fatdirstamp) · [`FilesystemAllocationMapCompleter`](#filesystemallocationmapcompleter) · [`FilesystemCompressionParameter`](#filesystemcompressionparameter) · [`FilesystemCompressionProfile`](#filesystemcompressionprofile) · [`FilesystemDirectoryEntry`](#filesystemdirectoryentry) · [`FilesystemDriverBindingKind`](#filesystemdriverbindingkind) · [`FilesystemDriverCapabilities`](#filesystemdrivercapabilities) · [`FilesystemDriverCoverage`](#filesystemdrivercoverage) · [`FilesystemDriverDerivation`](#filesystemdriverderivation) · [`FilesystemDriverProfile`](#filesystemdriverprofile) · [`FilesystemDriverReadinessLayer`](#filesystemdriverreadinesslayer) · [`FilesystemDriverReadinessReport`](#filesystemdriverreadinessreport) · [`FilesystemDriverTarget`](#filesystemdrivertarget) · [`FilesystemMetadataPatch`](#filesystemmetadatapatch) · [`FilesystemMutationModel`](#filesystemmutationmodel) · [`FilesystemNodeId`](#filesystemnodeid) · [`FilesystemNodeInfo`](#filesystemnodeinfo) · [`FilesystemNodeKind`](#filesystemnodekind) · [`FilesystemOpenOptions`](#filesystemopenoptions) · [`FilesystemOptimization`](#filesystemoptimization) · [`FilesystemOptimizationAdapters`](#filesystemoptimizationadapters) · [`FilesystemOptimizationAdapters.HardLinkDeduplicator`](#filesystemoptimizationadaptershardlinkdeduplicator) · [`FilesystemOptimizationAdapters.SymbolicLinkDeduplicator`](#filesystemoptimizationadapterssymboliclinkdeduplicator) · [`FilesystemOptimizationExtensions`](#filesystemoptimizationextensions) · [`FilesystemOptimizationFeatures`](#filesystemoptimizationfeatures) · [`FilesystemOptimizationOptions`](#filesystemoptimizationoptions) · [`FilesystemSchemaPresets`](#filesystemschemapresets) · [`FilesystemSnapshotDirectoryEntry`](#filesystemsnapshotdirectoryentry) · [`FilesystemSnapshotNode`](#filesystemsnapshotnode) · [`FormatCapabilities`](#formatcapabilities) · [`FormatCategory`](#formatcategory) · [`FormatCreateOptions`](#formatcreateoptions) · [`FormatDetectionSignature`](#formatdetectionsignature) · [`FormatHeaderMatch`](#formatheadermatch) · [`FormatHealth`](#formathealth) · [`FormatHelpers`](#formathelpers) · [`FormatMethodInfo`](#formatmethodinfo) · [`FormatOptionDescriptor`](#formatoptiondescriptor) · [`FormatOptionKeys`](#formatoptionkeys) · [`FormatOptionKind`](#formatoptionkind) · [`FormatRegistry`](#formatregistry) · [`HardLinkDeduplicationSemantics`](#hardlinkdeduplicationsemantics) · [`IArchiveCreatable`](#iarchivecreatable) · [`IArchiveDefragmentable`](#iarchivedefragmentable) · [`IArchiveFormatOperations`](#iarchiveformatoperations) · [`IArchiveInMemoryExtract`](#iarchiveinmemoryextract) · [`IArchiveLayoutMap`](#iarchivelayoutmap) · [`IArchiveModifiable`](#iarchivemodifiable) · [`IArchivePurgeable`](#iarchivepurgeable) · [`IArchiveShrinkable`](#iarchiveshrinkable) · [`IArchiveWriteConstraints`](#iarchivewriteconstraints) · [`IAsyncArchiveOperations`](#iasyncarchiveoperations) · [`IAudioContainerFormat`](#iaudiocontainerformat) · [`IAudioDemuxSource`](#iaudiodemuxsource) · [`IAudioMuxTarget`](#iaudiomuxtarget) · [`IAudioPcmSource`](#iaudiopcmsource) · [`IAudioPcmTarget`](#iaudiopcmtarget) · [`IBlockDeviceFilesystemDriverProvider`](#iblockdevicefilesystemdriverprovider) · [`IBlockDeviceProvider`](#iblockdeviceprovider) · [`IBuildingBlock`](#ibuildingblock) · [`IContainerRemuxable`](#icontainerremuxable) · [`IFileInternalChunkMover`](#ifileinternalchunkmover) · [`IFileInternalLayoutMap`](#ifileinternallayoutmap) · [`IFilesystemBlockMover`](#ifilesystemblockmover) · [`IFilesystemDriverAdapter`](#ifilesystemdriveradapter) · [`IFilesystemDriverProvider`](#ifilesystemdriverprovider) · [`IFilesystemDriverReadinessProvider`](#ifilesystemdriverreadinessprovider) · [`IFilesystemExtentMap`](#ifilesystemextentmap) · [`IFilesystemFileHandle`](#ifilesystemfilehandle) · [`IFilesystemMetadataMover`](#ifilesystemmetadatamover) · [`IFilesystemPlaceable`](#ifilesystemplaceable) · [`IFilesystemScrambleable`](#ifilesystemscrambleable) · [`IFilesystemSession`](#ifilesystemsession) · [`IFilesystemTransaction`](#ifilesystemtransaction) · [`IFormatDescriptor`](#iformatdescriptor) · [`IFormatDetectionSource`](#iformatdetectionsource) · [`IFormatOptionsSchema`](#iformatoptionsschema) · [`IFormatValidator`](#iformatvalidator) · [`ILayoutOptimizable`](#ilayoutoptimizable) · [`IPartitionEditable`](#ipartitioneditable) · [`IRandomAccessBlockDevice`](#irandomaccessblockdevice) · [`IRandomAccessBlockDeviceProvider`](#irandomaccessblockdeviceprovider) · [`IRawTrackDevice`](#irawtrackdevice) · [`IRawTrackDeviceProvider`](#irawtrackdeviceprovider) · [`IStreamFormatOperations`](#istreamformatoperations) · [`ISymbolicLinkDeduplicationLayout`](#isymboliclinkdeduplicationlayout) · [`ISyntheticEntryNames`](#isyntheticentrynames) · [`IWipeEmpty`](#iwipeempty) · [`InnerFsDetector`](#innerfsdetector) · [`IssueSeverity`](#issueseverity) · [`LayoutAnalysis`](#layoutanalysis) · [`LayoutPatch`](#layoutpatch) · [`LayoutProfile`](#layoutprofile) · [`LayoutRebuildOptions`](#layoutrebuildoptions) · [`LayoutReclaim`](#layoutreclaim) · [`MagicSignature`](#magicsignature) · [`MediaProfile`](#mediaprofile) · [`MediaProfileLookup`](#mediaprofilelookup) · [`MetadataPlacementProfile`](#metadataplacementprofile) · [`MetadataPlacementRule`](#metadataplacementrule) · [`MetadataZone`](#metadatazone) · [`MethodNameParser`](#methodnameparser) · [`ModifyRebuilder`](#modifyrebuilder) · [`MutableRebuildFilesystemSession`](#mutablerebuildfilesystemsession) · [`MutableRebuildFilesystemSession.RebuildImage`](#mutablerebuildfilesystemsessionrebuildimage) · [`MutableRebuildFilesystemSession.ValidateImage`](#mutablerebuildfilesystemsessionvalidateimage) · [`PartitionBlockDevice`](#partitionblockdevice) · [`PlacementOptions`](#placementoptions) · [`PlacementZone`](#placementzone) · [`RawDiskShrinkRebuilder`](#rawdiskshrinkrebuilder) · [`RawTrackInfo`](#rawtrackinfo) · [`ReadOnlyFilesystemSnapshotSession`](#readonlyfilesystemsnapshotsession) · [`RebuildFilesystemEntry`](#rebuildfilesystementry) · [`RebuildVerb`](#rebuildverb) · [`ScrambleOptions`](#scrambleoptions) · [`SpoolingReadOnlyFileHandle`](#spoolingreadonlyfilehandle) · [`StreamBlockDevice`](#streamblockdevice) · [`SymlinkResolver`](#symlinkresolver) · [`UnusedSpaceWiper`](#unusedspacewiper) · [`ValidationIssue`](#validationissue) · [`ValidationLevel`](#validationlevel) · [`ValidationResult`](#validationresult) · [`WholeImageRebuildCommitter`](#wholeimagerebuildcommitter) +[`AlgorithmFamily`](#algorithmfamily) · [`ApeTagReader`](#apetagreader) · [`ApeTagReader.ApeTag`](#apetagreaderapetag) · [`ArchiveEntryInfo`](#archiveentryinfo) · [`ArchiveFormatOperationsExtensions`](#archiveformatoperationsextensions) · [`ArchiveInputInfo`](#archiveinputinfo) · [`ArchiveMutationOptions`](#archivemutationoptions) · [`ArchiveShrinker`](#archiveshrinker) · [`AudioEncodedStream`](#audioencodedstream) · [`AudioPacket`](#audiopacket) · [`AudioPcmBuffer`](#audiopcmbuffer) · [`AudioPcmEncoding`](#audiopcmencoding) · [`AudioPcmFormat`](#audiopcmformat) · [`AudioPseudoArchive`](#audiopseudoarchive) · [`AudioPseudoArchive.Entry`](#audiopseudoarchiveentry) · [`AudioStreamFormat`](#audiostreamformat) · [`BlockDeviceGeometry`](#blockdevicegeometry) · [`BlockDeviceStream`](#blockdevicestream) · [`BuildingBlockRegistry`](#buildingblockregistry) · [`CompoundTarDescriptor`](#compoundtardescriptor) · [`DefragBlockClass`](#defragblockclass) · [`DefragBlockInfo`](#defragblockinfo) · [`DefragBlockKind`](#defragblockkind) · [`DefragContentGuard`](#defragcontentguard) · [`DefragMode`](#defragmode) · [`DefragOptions`](#defragoptions) · [`DefragProgressEvent`](#defragprogressevent) · [`DefragRebuilder`](#defragrebuilder) · [`EntropyDetector`](#entropydetector) · [`FatDirStamp`](#fatdirstamp) · [`FilesystemAllocationMapCompleter`](#filesystemallocationmapcompleter) · [`FilesystemCompressionParameter`](#filesystemcompressionparameter) · [`FilesystemCompressionProfile`](#filesystemcompressionprofile) · [`FilesystemDirectoryEntry`](#filesystemdirectoryentry) · [`FilesystemDriverBindingKind`](#filesystemdriverbindingkind) · [`FilesystemDriverCapabilities`](#filesystemdrivercapabilities) · [`FilesystemDriverCoverage`](#filesystemdrivercoverage) · [`FilesystemDriverDerivation`](#filesystemdriverderivation) · [`FilesystemDriverProfile`](#filesystemdriverprofile) · [`FilesystemDriverReadinessLayer`](#filesystemdriverreadinesslayer) · [`FilesystemDriverReadinessReport`](#filesystemdriverreadinessreport) · [`FilesystemDriverTarget`](#filesystemdrivertarget) · [`FilesystemMetadataPatch`](#filesystemmetadatapatch) · [`FilesystemMutationModel`](#filesystemmutationmodel) · [`FilesystemNodeId`](#filesystemnodeid) · [`FilesystemNodeInfo`](#filesystemnodeinfo) · [`FilesystemNodeKind`](#filesystemnodekind) · [`FilesystemOpenOptions`](#filesystemopenoptions) · [`FilesystemOptimization`](#filesystemoptimization) · [`FilesystemOptimizationAdapters`](#filesystemoptimizationadapters) · [`FilesystemOptimizationAdapters.HardLinkDeduplicator`](#filesystemoptimizationadaptershardlinkdeduplicator) · [`FilesystemOptimizationAdapters.SymbolicLinkDeduplicator`](#filesystemoptimizationadapterssymboliclinkdeduplicator) · [`FilesystemOptimizationExtensions`](#filesystemoptimizationextensions) · [`FilesystemOptimizationFeatures`](#filesystemoptimizationfeatures) · [`FilesystemOptimizationOptions`](#filesystemoptimizationoptions) · [`FilesystemSchemaPresets`](#filesystemschemapresets) · [`FilesystemSnapshotDirectoryEntry`](#filesystemsnapshotdirectoryentry) · [`FilesystemSnapshotNode`](#filesystemsnapshotnode) · [`FormatCapabilities`](#formatcapabilities) · [`FormatCategory`](#formatcategory) · [`FormatCreateOptions`](#formatcreateoptions) · [`FormatDetectionSignature`](#formatdetectionsignature) · [`FormatHeaderMatch`](#formatheadermatch) · [`FormatHealth`](#formathealth) · [`FormatHelpers`](#formathelpers) · [`FormatMethodInfo`](#formatmethodinfo) · [`FormatOptionDescriptor`](#formatoptiondescriptor) · [`FormatOptionKeys`](#formatoptionkeys) · [`FormatOptionKind`](#formatoptionkind) · [`FormatRegistry`](#formatregistry) · [`HardLinkDeduplicationSemantics`](#hardlinkdeduplicationsemantics) · [`IArchiveCreatable`](#iarchivecreatable) · [`IArchiveDefragmentable`](#iarchivedefragmentable) · [`IArchiveFormatOperations`](#iarchiveformatoperations) · [`IArchiveInMemoryExtract`](#iarchiveinmemoryextract) · [`IArchiveLayoutMap`](#iarchivelayoutmap) · [`IArchiveModifiable`](#iarchivemodifiable) · [`IArchivePurgeable`](#iarchivepurgeable) · [`IArchiveShrinkable`](#iarchiveshrinkable) · [`IArchiveWriteConstraints`](#iarchivewriteconstraints) · [`IAsyncArchiveOperations`](#iasyncarchiveoperations) · [`IAudioContainerFormat`](#iaudiocontainerformat) · [`IAudioDemuxSource`](#iaudiodemuxsource) · [`IAudioMuxTarget`](#iaudiomuxtarget) · [`IAudioPcmSource`](#iaudiopcmsource) · [`IAudioPcmTarget`](#iaudiopcmtarget) · [`IBlockDeviceFilesystemDriverProvider`](#iblockdevicefilesystemdriverprovider) · [`IBlockDeviceProvider`](#iblockdeviceprovider) · [`IBuildingBlock`](#ibuildingblock) · [`IContainerRemuxable`](#icontainerremuxable) · [`IFileInternalChunkMover`](#ifileinternalchunkmover) · [`IFileInternalLayoutMap`](#ifileinternallayoutmap) · [`IFilesystemBlockMover`](#ifilesystemblockmover) · [`IFilesystemDriverAdapter`](#ifilesystemdriveradapter) · [`IFilesystemDriverProvider`](#ifilesystemdriverprovider) · [`IFilesystemDriverReadinessProvider`](#ifilesystemdriverreadinessprovider) · [`IFilesystemExtentMap`](#ifilesystemextentmap) · [`IFilesystemFileHandle`](#ifilesystemfilehandle) · [`IFilesystemMetadataMover`](#ifilesystemmetadatamover) · [`IFilesystemPlaceable`](#ifilesystemplaceable) · [`IFilesystemScrambleable`](#ifilesystemscrambleable) · [`IFilesystemSession`](#ifilesystemsession) · [`IFilesystemTransaction`](#ifilesystemtransaction) · [`IFormatDescriptor`](#iformatdescriptor) · [`IFormatDetectionSource`](#iformatdetectionsource) · [`IFormatOptionsSchema`](#iformatoptionsschema) · [`IFormatValidator`](#iformatvalidator) · [`ILayoutOptimizable`](#ilayoutoptimizable) · [`IPartitionEditable`](#ipartitioneditable) · [`IRandomAccessBlockDevice`](#irandomaccessblockdevice) · [`IRandomAccessBlockDeviceProvider`](#irandomaccessblockdeviceprovider) · [`IRawTrackDevice`](#irawtrackdevice) · [`IRawTrackDeviceProvider`](#irawtrackdeviceprovider) · [`IStreamFormatOperations`](#istreamformatoperations) · [`ISymbolicLinkDeduplicationLayout`](#isymboliclinkdeduplicationlayout) · [`ISyntheticEntryNames`](#isyntheticentrynames) · [`IWipeEmpty`](#iwipeempty) · [`InnerFsDetector`](#innerfsdetector) · [`IssueSeverity`](#issueseverity) · [`LayoutAnalysis`](#layoutanalysis) · [`LayoutPatch`](#layoutpatch) · [`LayoutProfile`](#layoutprofile) · [`LayoutRebuildOptions`](#layoutrebuildoptions) · [`LayoutReclaim`](#layoutreclaim) · [`MagicSignature`](#magicsignature) · [`MediaProfile`](#mediaprofile) · [`MediaProfileLookup`](#mediaprofilelookup) · [`MetadataPlacementProfile`](#metadataplacementprofile) · [`MetadataPlacementRule`](#metadataplacementrule) · [`MetadataZone`](#metadatazone) · [`MethodNameParser`](#methodnameparser) · [`ModifyRebuilder`](#modifyrebuilder) · [`MutableRebuildFilesystemSession`](#mutablerebuildfilesystemsession) · [`MutableRebuildFilesystemSession.RebuildImage`](#mutablerebuildfilesystemsessionrebuildimage) · [`MutableRebuildFilesystemSession.ValidateImage`](#mutablerebuildfilesystemsessionvalidateimage) · [`PartitionBlockDevice`](#partitionblockdevice) · [`PlacementOptions`](#placementoptions) · [`PlacementZone`](#placementzone) · [`RawDiskShrinkRebuilder`](#rawdiskshrinkrebuilder) · [`RawTrackInfo`](#rawtrackinfo) · [`ReadOnlyFilesystemSnapshotSession`](#readonlyfilesystemsnapshotsession) · [`RebuildFilesystemEntry`](#rebuildfilesystementry) · [`RebuildVerb`](#rebuildverb) · [`ScrambleOptions`](#scrambleoptions) · [`SpoolingReadOnlyFileHandle`](#spoolingreadonlyfilehandle) · [`StreamBlockDevice`](#streamblockdevice) · [`SymlinkResolver`](#symlinkresolver) · [`UnusedSpaceWiper`](#unusedspacewiper) · [`ValidationIssue`](#validationissue) · [`ValidationLevel`](#validationlevel) · [`ValidationResult`](#validationresult) · [`WholeImageRebuildCommitter`](#wholeimagerebuildcommitter) #### `AlgorithmFamily` @@ -3885,6 +3885,24 @@ Implements `IEquatable`. | `OriginalSize` | `long OriginalSize { get; init; }` | The entry's own uncompressed on-disk size. For a symbolic link this is the byte length of the stored target path (the on-disk truth), NOT the size of whatever the link points at — see `TargetSize` for the resolved target size. | | `TargetSize` | `long? TargetSize { get; init; }` | The size of the file the link ultimately resolves to, when it points at a regular file within the same filesystem listing; null when unresolved (absolute target, target outside the listing, a directory target, or a dangling/cyclic link). Filled by `SymlinkResolver`. | +#### `ArchiveFormatOperationsExtensions` + +Makes the default archive input-mode members available when a descriptor is referenced by its concrete type. Default interface members are otherwise only in the member set of an `IArchiveFormatOperations` reference. + +| Member | Signature | Summary | +| --- | --- | --- | +| `ExtractEntryToMemorySpan` | `static byte[] ExtractEntryToMemorySpan(this IArchiveFormatOperations operations, ReadOnlySpan archive, string entryName, string password)` | Extracts one entry from an in-memory archive image into a new byte array. | +| `ExtractEntryToMemoryStreaming` | `static byte[] ExtractEntryToMemoryStreaming(this IArchiveFormatOperations operations, Stream archive, string entryName, string password)` | Extracts one entry from a forward-only or seekable archive source into memory. | +| `ExtractSeekable` | `static void ExtractSeekable(this IArchiveFormatOperations operations, Stream archive, string outputDir, string password, string[] files)` | Extracts entries through the explicit seek-based path. The supplied stream must support seeking; it is rewound before the descriptor's native reader is invoked. | +| `ExtractSpan` | `static void ExtractSpan(this IArchiveFormatOperations operations, ReadOnlySpan archive, string outputDir, string password, string[] files)` | Extracts entries from an in-memory archive image. Native span parsers can override this method to avoid the compatibility copy used by the default implementation. | +| `ExtractStreaming` | `static void ExtractStreaming(this IArchiveFormatOperations operations, Stream archive, string outputDir, string password, string[] files)` | Extracts entries from a forward-only or seekable stream. Descriptors with a native one-pass parser should override this method; the default spools only when necessary. | +| `ListSeekable` | `static List ListSeekable(this IArchiveFormatOperations operations, Stream archive, string password)` | Lists entries through the explicit seek-based path. The supplied stream must support seeking; it is rewound before the descriptor's native reader is invoked. | +| `ListSpan` | `static List ListSpan(this IArchiveFormatOperations operations, ReadOnlySpan archive, string password)` | Lists entries from an in-memory archive image. The default compatibility bridge copies the span once because a `Stream` cannot safely retain a borrowed span; native span parsers should override this method to remain allocation-free. | +| `ListStreaming` | `static List ListStreaming(this IArchiveFormatOperations operations, Stream archive, string password)` | Lists entries from a forward-only or seekable stream. This is the libarchive-style streaming entry point: callers do not need to provide seek capability. | +| `OpenEntrySeekable` | `static Stream OpenEntrySeekable(this IArchiveFormatOperations operations, Stream archive, string entryName, string password)` | Opens one entry through the explicit seek-based path. The archive is rewound before the descriptor-specific entry reader is invoked. | +| `OpenEntrySpan` | `static Stream OpenEntrySpan(this IArchiveFormatOperations operations, ReadOnlySpan archive, string entryName, string password)` | Opens one entry from an in-memory archive image. Because the returned stream may outlive this call, the default bridge owns one copy of the supplied span until that stream is disposed. Native span readers can override this method when they can return independently owned output. | +| `OpenEntryStreaming` | `static Stream OpenEntryStreaming(this IArchiveFormatOperations operations, Stream archive, string entryName, string password)` | Opens one entry from a forward-only or seekable archive source. A temporary spool, when required, stays alive until the returned entry stream is disposed. | + #### `ArchiveInputInfo` Describes a single input file/directory for archive creation. @@ -4840,9 +4858,20 @@ The base capability every archive descriptor implements: list entries and extrac | Member | Signature | Summary | | --- | --- | --- | +| `ExtractEntryToMemorySpan` | `byte[] ExtractEntryToMemorySpan(ReadOnlySpan archive, string entryName, string password)` | Extracts one entry from an in-memory archive image into a new byte array. | +| `ExtractEntryToMemoryStreaming` | `byte[] ExtractEntryToMemoryStreaming(Stream archive, string entryName, string password)` | Extracts one entry from a forward-only or seekable archive source into memory. | | `ExtractEntryToMemory` | `byte[] ExtractEntryToMemory(Stream archive, string entryName, string password)` | Extracts a single entry to a byte array. This is the explicitly buffered convenience API; callers working with large entries should use `OpenEntry` instead. | -| `Extract` | `void Extract(Stream stream, string outputDir, string password, string[] files)` | Extract entries from the archive to an output directory. | -| `List` | `List List(Stream stream, string password)` | List all entries in the archive. | +| `ExtractSeekable` | `void ExtractSeekable(Stream archive, string outputDir, string password, string[] files)` | Extracts entries through the explicit seek-based path. The supplied stream must support seeking; it is rewound before the descriptor's native reader is invoked. | +| `ExtractSpan` | `void ExtractSpan(ReadOnlySpan archive, string outputDir, string password, string[] files)` | Extracts entries from an in-memory archive image. Native span parsers can override this method to avoid the compatibility copy used by the default implementation. | +| `ExtractStreaming` | `void ExtractStreaming(Stream archive, string outputDir, string password, string[] files)` | Extracts entries from a forward-only or seekable stream. Descriptors with a native one-pass parser should override this method; the default spools only when necessary. | +| `Extract` | `void Extract(Stream stream, string outputDir, string password, string[] files)` | Extract entries from the archive to an output directory using the descriptor's native stream path. | +| `ListSeekable` | `List ListSeekable(Stream archive, string password)` | Lists entries through the explicit seek-based path. The supplied stream must support seeking; it is rewound before the descriptor's native reader is invoked. | +| `ListSpan` | `List ListSpan(ReadOnlySpan archive, string password)` | Lists entries from an in-memory archive image. The default compatibility bridge copies the span once because a `Stream` cannot safely retain a borrowed span; native span parsers should override this method to remain allocation-free. | +| `ListStreaming` | `List ListStreaming(Stream archive, string password)` | Lists entries from a forward-only or seekable stream. This is the libarchive-style streaming entry point: callers do not need to provide seek capability. | +| `List` | `List List(Stream stream, string password)` | List all entries in the archive using the descriptor's native stream path. | +| `OpenEntrySeekable` | `Stream OpenEntrySeekable(Stream archive, string entryName, string password)` | Opens one entry through the explicit seek-based path. The archive is rewound before the descriptor-specific entry reader is invoked. | +| `OpenEntrySpan` | `Stream OpenEntrySpan(ReadOnlySpan archive, string entryName, string password)` | Opens one entry from an in-memory archive image. Because the returned stream may outlive this call, the default bridge owns one copy of the supplied span until that stream is disposed. Native span readers can override this method when they can return independently owned output. | +| `OpenEntryStreaming` | `Stream OpenEntryStreaming(Stream archive, string entryName, string password)` | Opens one entry from a forward-only or seekable archive source. A temporary spool, when required, stays alive until the returned entry stream is disposed. | | `OpenEntry` | `Stream OpenEntry(Stream archive, string entryName, string password)` | Opens a single entry as a read-only `Stream` bounded to that entry's logical bytes — physically incapable of reading slack space, adjacent entries, padding/alignment fillers, or header/metadata regions. This is the canonical per-entry isolation primitive used by streaming conversion and derived-filesystem pipelines. | #### `IArchiveInMemoryExtract`