Table of Contents

CompoundReadStrategy Enum

Definition

Namespace
Bodu.IO.Compound
Assembly
Bodu.IO.Compound.dll
Package
Bodu.IO.Compound 1.0.0
Source
CompoundReadStrategy.cs

Specifies how the compound-file reader sources the bytes of an opened container.

public enum CompoundReadStrategy
Extension Methods

Fields

Buffered = 0

The default: read the whole file into memory at open time, so access never touches the original source afterward.

Streaming = 1

Read sectors on demand from a seekable source, bounding memory for large files. The source must remain open and unmodified for the lifetime of the returned file.

Auto = 2

Choose Buffered for small sources and Streaming for large ones, comparing a seekable source's length against MaxBufferedBytes.

Remarks

// Bound memory for a large container: read sectors on demand instead of buffering it all.
using var file = CompoundFile.OpenRead("large-archive.msg", new CompoundFileOptions
{
    ReadStrategy = CompoundReadStrategy.Streaming,
});

// Or let the reader pick per source: Buffered below MaxBufferedBytes, Streaming above it.
var options = new CompoundFileOptions { ReadStrategy = CompoundReadStrategy.Auto };

Applies to

ProductVersions
.NET8, 10