API Reference
Class
ReaderInputLimits
Shared input-size guard helpers for reader adapters.
Inheritance
- Object
- ReaderInputLimits
Methods
public static Void EnforceFileSize(String path, Nullable<Int64> maxBytes) #Returns:
VoidEnforces maxBytes against file length when available.
Parameters
- path System.String
- maxBytes System.Nullable{System.Int64}
public static Void EnforceSeekableStreamSize(Stream stream, Nullable<Int64> maxBytes) #Returns:
VoidEnforces maxBytes against stream length when seekable.
Parameters
- stream System.IO.Stream
- maxBytes System.Nullable{System.Int64}
public static Stream EnsureSeekableReadStream(Stream stream, Nullable<Int64> maxInputBytes, CancellationToken cancellationToken, out Boolean ownsStream) #Returns:
StreamCreates a seekable snapshot for parsers that require rewind/index operations. Seekable inputs are read from the beginning and restored to their original position. Non-seekable inputs are read from their current forward position.
Parameters
- stream System.IO.Stream
- maxInputBytes System.Nullable{System.Int64}
- cancellationToken System.Threading.CancellationToken
- ownsStream System.Boolean@
public static async Task<Stream> EnsureSeekableReadStreamAsync(Stream stream, Nullable<Int64> maxInputBytes, CancellationToken cancellationToken = null) #Returns:
Task<Stream>Asynchronously creates a seekable stream snapshot for parsers that require rewind/index operations. Seekable inputs are read from the beginning and restored to their original position. Non-seekable inputs are read from their current forward position. The returned snapshot must be disposed by the caller.
Parameters
- stream System.IO.Stream
- maxInputBytes System.Nullable{System.Int64}
- cancellationToken System.Threading.CancellationToken = null
Inherited Methods
public override Boolean Equals(Object obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object