Class
Lz4Archive
OfficeIMO.Archives
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
- destination System.IO.Stream
- cancellationToken System.Threading.CancellationToken = default
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
- leaveOpen bool = false
Returns
Streampublic 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
- destination System.IO.Stream
- options OfficeIMO.Archives.ArchiveReadOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Lz4ReadResultExceptions
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.