StreamOutputAdapter

StreamOutputAdapter class

Represents an output adapter that collects output into a Stream.

public class StreamOutputAdapter : OutputAdapter

Constructors

Name Description
StreamOutputAdapter(OutputFormat, Stream) Initializes a new instance of the StreamOutputAdapter class.

Properties

Name Description
OutputFormat { get; } Gets the output format.
Stream { get; } Gets an output stream.

Remarks

Learn more

Examples

The example demonstrates a typical usage of the class.

string indexFolder = @"c:\MyIndex\";
string documentsFolder = @"c:\MyDocuments\";

Index index = new Index(indexFolder); // Creating an index in the specified folder

index.Add(documentsFolder); // Indexing documents from the specified folder

DocumentInfo[] documents = index.GetIndexedDocuments(); // Getting information on indexed documents

using (Stream stream = new MemoryStream()) // Creating a stream
{
    StreamOutputAdapter adapter = new StreamOutputAdapter(stream); // Creating a stream output adapter
    index.GetDocumentText(documents[0], adapter); // Generating a document text into the stream
}

See Also