# Load file from stream Pass a FileStream or any System.IO.Stream directly to the Comparer constructor and Add() method to compare documents without saving them to disk first in GroupDocs.Comparison for .NET. To avoid the saving stream as a file, [GroupDocs.Comparison](https://products.groupdocs.com/comparison/net) allows you to work with file streams directly. To work with stream, follow these steps: 1. Obtain file stream. 2. Pass opened source file stream to the [Comparer](https://reference.groupdocs.com/comparison/net/groupdocs.comparison/comparer) class constructor or passĀ opened target file stream to the [Add](https://reference.groupdocs.com/comparison/net/groupdocs.comparison/comparer/methods/add/index) method. The following code snippet shows how to load file from stream: {{< tabs "example1">}} {{< tab "C#" >}} ```csharp using GroupDocs.Comparison; using System.IO; // ... using (Stream sourceStream = File.OpenRead("source.docx")) using (Stream targetStream = File.OpenRead("target.docx")) { using (Comparer comparer = new Comparer(sourceStream)) { comparer.Add(targetStream); comparer.Compare(File.Create("result.docx")); } } ``` {{< /tab >}} {{< /tabs >}} ## See also - [Load file from local disk]({{< ref "comparison/net/advanced-usage/loading/load-file-from-local-disk.md" >}}) - [Load password-protected documents]({{< ref "comparison/net/advanced-usage/loading/load-password-protected-documents.md" >}}) - [Compare documents]({{< ref "comparison/net/comparison-basic/compare-documents.md" >}})