Table of Contents

Method TryDetectReader

Namespace
DocWright.Core.Formats
Assembly
DocWright.Core.dll

TryDetectReader(Stream, out IDocumentReader?)

Detects the reader for a stream by asking each registered reader to sniff it, in registration order. The stream position is restored after every probe.

public bool TryDetectReader(Stream stream, out IDocumentReader? reader)

Parameters

stream Stream

The seekable stream to probe.

reader IDocumentReader

The first reader whose sniff succeeded, or null.

Returns

bool

true if a reader recognized the stream.

Exceptions

ArgumentNullException

stream is null.

ArgumentException

stream is not seekable.