> ## 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 as reading from file.

## Methods

| **Name** | **Description** |
| - | - |
| [**Close**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/ireadstream-close.md) | Finishes using the stream. All allocated resources can be released. |
| [**Read**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/ireadstream-read.md) | Reads the specified number of bytes from the stream. |

## Input parameter

The following methods receive a pointer to this interface as an input parameter:

* [**OpenImageFileFromStream**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/imageprocessingtools-openimagefilefromstream.md) method of the [**ImageProcessingTools**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/imageprocessingtools.md) object
* [**LoadFlexibleDescriptionFromStream**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/sectiondefinition-loadflexibledescriptionfromstream.md) method of the [**SectionDefinition**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/sectiondefinition.md) object
* [**AddImageFromStream**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batch-addimagefromstream.md) method of the [**Batch**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batch.md) object

## Samples

> [accordion] 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;
>  }
> }
> ```
