> ## 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 インターフェイス

これは読み取りストリーム用のインターフェイスです。このインターフェイスとそのすべてのメソッドは、クライアント側で実装します。読み取りストリームは、たとえばファイルからの読み取りとして実装できます。

## メソッド

| **Name** | **Description** |
| - | - |
| [**Close**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/ireadstream-close.md) | ストリームの使用を終了します。割り当てられたリソースはすべて解放できます。 |
| [**Read**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/ireadstream-read.md) | 指定したバイト数をストリームから読み取ります。 |

## 入力パラメーター

次のメソッドは、このインターフェイスへのポインターを入力パラメーターとして受け取ります。

* [**ImageProcessingTools**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/imageprocessingtools.md) オブジェクトの [**OpenImageFileFromStream**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/imageprocessingtools-openimagefilefromstream.md) メソッド
* [**SectionDefinition**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/sectiondefinition.md) オブジェクトの [**LoadFlexibleDescriptionFromStream**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/sectiondefinition-loadflexibledescriptionfromstream.md) メソッド
* [**Batch**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/batch.md) オブジェクトの [**AddImageFromStream**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/batch-addimagefromstream.md) メソッド

## サンプル

> [accordion] C# コード
>
> ```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;
>  }
> }
> ```
