Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

Lz4Archive

OfficeIMO.Archives

Namespace
OfficeIMO.Archives
Assembly
OfficeIMO.Archives
Source revision
12511d2fa560 with working tree changes
Modifiers
static

Reads and writes LZ4 frame streams in managed code.

Inheritance

  • object
  • Lz4Archive

Methods

public static void Compress(Stream source, Stream destination, CancellationToken cancellationToken = default) #

Compresses the source from its current position through EOF as one deterministic LZ4 frame. Both streams stay open. Cancellation or I/O failure can leave an incomplete frame in the destination.

Parameters

source System.IO.Stream required
destination System.IO.Stream required
cancellationToken System.Threading.CancellationToken = default optional
public static Stream CreateWriter(Stream destination, bool leaveOpen = false) #

Returns a stream that writes one deterministic LZ4 frame with independent 64 KiB blocks and block and content checksums. Dispose the writer to finish the frame.

Parameters

destination System.IO.Stream required
leaveOpen bool = false optional

Returns

Stream
public static Lz4ReadResult Decompress(Stream source, Stream destination, ArchiveReadOptions? options = null, CancellationToken cancellationToken = default) #

Decompresses concatenated LZ4 frames, including independent and linked blocks, into the destination. Optional block and content checksums and declared content sizes are verified.

Parameters

source System.IO.Stream required
destination System.IO.Stream required
options OfficeIMO.Archives.ArchiveReadOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Exceptions

  • ArchiveCorruptionException – The input is not a complete valid LZ4 stream.
  • NotSupportedException – The frame declares a preset dictionary or unsupported version.
  • OfficeInspectionResourceLimitException – A configured limit is exceeded.