Close
dtSearch .NET Standard API 2023.02
DataSource.DocStream Property

Use DocStream to provide access to binary document data for this document in the data source.

System.IO.Stream DocStream;

dtSearch treats the contents of DocStream as if it were a file found on disk, so it can be any binary document format that dtSearch supports, such as a PDF file, DOC file, XLS file, etc. The contents of the document in DocStream, along with any properties such as Office Summary Information fields, are combined with the field-value pairs in DocFields and indexed as a single document.  

DocStream can be any .NET class derived from System.IO.Stream, as long as the class supports Read() and Seek() and returns true from both CanRead and CanSeek. Because DocStream will be invoked from within unmanaged code, any exceptions that occur during a Read() or Seek() call should be handled internally by the class.  

The DataSource interface provides three ways to return a binary document: DocStream (any .NET Stream object), DocBytes (a byte array), and DocIsFile (a disk file). Only one of these can be used for each document.