Method CanRead
CanRead(Stream)
Sniffs whether a stream looks like RTF, restoring its position before returning.
public bool CanRead(Stream stream)
Parameters
streamStreamThe seekable stream to sniff.
Returns
Remarks
RTF has a real signature — every conforming document begins {\rtf — which makes
this probe both cheap and safe, unlike HTML's. Leading whitespace and a UTF-8 byte
order mark are tolerated because both appear in the wild.
Exceptions
- ArgumentNullException
streamis null.- ArgumentException
The stream is not seekable.