PstFileOptions Class
Definition
Controls how a PstFile is opened and validated.
public sealed class PstFileOptions
- Inheritance
-
PstFileOptions
- Inherited Members
- Extension Methods
Constructors
PstFileOptions()
public PstFileOptions()
Properties
BlockCacheSize
Gets the maximum number of decoded pages and block payloads the session keeps in its least-recently-used cache.
public int BlockCacheSize { get; init; }
Property Value
- int
The cache entry budget;
256by default.0disables caching entirely.
Remarks
Every cached entry is at most one block (8,192 bytes), so the default budget bounds the cache at roughly 2 MB per open session. Repeated structural reads - B-tree walks, property-context and table-context access over the same nodes - are served from the cache instead of re-reading and re-decoding from the source stream.
Exceptions
- ArgumentOutOfRangeException
The value is negative.
MaxDataTreeLeaves
Gets the largest number of leaf data blocks a node's data tree may reference.
public int MaxDataTreeLeaves { get; init; }
Property Value
- int
The fan-out limit; 65,536 by default.
Remarks
The limit is enforced while the tree's internal blocks are walked, before any leaf payload is read, and applies to streaming and buffered reads alike - the leaf list itself is the allocation it bounds. A tree exceeding it is refused with PstFileFormatException and LimitExceeded.
Exceptions
- ArgumentOutOfRangeException
The value is zero or negative.
MaxNodeDataLength
Gets the largest node payload, in bytes, the session materializes in memory.
public long MaxNodeDataLength { get; init; }
Property Value
- long
The materialization limit; 256 MiB by default.
Remarks
The limit governs every read that assembles a node's whole payload - ReadAllBytes(), the heap-on-node parse behind the property and table contexts, and subnode-resident property values. It does not govern OpenDataStream(), which reads one block at a time and is unbounded by design.
A data tree declaring more than this is refused with PstFileFormatException and LimitExceeded at every validation level: a crafted tree can reference the same physical block many thousands of times, so the declared size - not the file size - is what bounds the allocation.
Exceptions
- ArgumentOutOfRangeException
The value is zero or negative.
ValidationLevel
Gets how strictly the file's structures and checksums are validated.
public PstValidationLevel ValidationLevel { get; init; }
Property Value
- PstValidationLevel
The validation level; Compatible by default.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |