> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IReadStream Interface

This is the interface for a read stream. This interface and all its methods are implemented on the client-side. A read stream may be implemented, for example, as reading from file.

## Methods

| Name                                                                                                  | Description                                                         |
| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| [Close](/fine-reader/engine/api-reference/supplementary-objects-and-methods/ireadstream/close-method) | Finishes using the stream. All allocated resources can be released. |
| [Read](/fine-reader/engine/api-reference/supplementary-objects-and-methods/ireadstream/read-method)   | Reads the specified number of bytes from the stream.                |

## Input parameter

This object is passed as an input parameter to the following methods:

* [IsPdfWithTextualContentFromStream](/fine-reader/engine/api-reference/engine-object-iengine-interface/processing-methods/ispdfwithtextualcontentfromstream-method) method of the [Engine](/fine-reader/engine/api-reference/engine-object-iengine-interface) object
* [IsPdfPortfolioFromStream](/fine-reader/engine/api-reference/engine-object-iengine-interface/processing-methods/ispdfportfoliofromstream-method) method of the [Engine](/fine-reader/engine/api-reference/engine-object-iengine-interface) object
* [CreateLayoutFromStream](/fine-reader/engine/api-reference/engine-object-iengine-interface/creation-methods/createlayoutfromstream-method) method of the [Engine](/fine-reader/engine/api-reference/engine-object-iengine-interface) object
* [AddImageFileFromStream](/fine-reader/engine/api-reference/document-related-objects/frdocument/addimagefilefromstream-method) method of the [FRDocument](/fine-reader/engine/api-reference/document-related-objects/frdocument) object in Linux and Windows

## Samples

<Accordion title="C# code">
  ```csharp theme={null}
  class ReadStream : IReadStream
  {
   private MemoryStream fileBytes = null;
   public ReadStream( byte[] _fileBytes )
   {
    fileBytes = new MemoryStream( _fileBytes );
   }
   public void Close()
   {
    fileBytes.Close();
   }
   public int Read( out byte[] data, int count )
   {
    data = new byte[count];
    int readBytes = fileBytes.Read( data, 0, count );
    return readBytes;
   }
  }
  ```
</Accordion>

## Remarks

In Linux, this interface does not work if the Engine object is loaded as an out-of-process server.

## See also

[FRDocument](/fine-reader/engine/api-reference/document-related-objects/frdocument)

[IWriteStream](/fine-reader/engine/api-reference/supplementary-objects-and-methods/iwritestream)

[IFileWriter](/fine-reader/engine/api-reference/supplementary-objects-and-methods/ifilewriter)
