# OpcFileReadMethodNode.FileReadCallback Delegate

<dl class="api-definition">
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
</dl>

Read is used to read a part of the file starting from the current file position. The file position is advanced by the number of bytes read.

## Syntax

<div class="api-signature" data-lang="csharp">

```csharp
public delegate ByteString OpcFileReadMethodNode.FileReadCallback(
    uint fileHandle,
    int length)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
<CLSCompliant(False)>
Public Delegate Function OpcFileReadMethodNode.FileReadCallback(
    fileHandle As UInteger,
    length As Integer) As ByteString
```

</div>

## Parameters

| Name | Type | Description |
|---|---|---|
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | A file handle indicating the access request and thus indirectly the position inside the file. |
| `length` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | Defines the length in byte that should be returned in data, starting from the current position of the file handle. If the end of file is reached only all data till the end of the file are returned. If the specified length is longer than the maximum allowed message size of the communication, only those data fitting into the message size are returned. Only positive values are allowed. |

## Returns

[ByteString](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.bytestring/)

Contains the returned data of the file.

## Applies to

| Package | Versions |
|---|---|
| Opc.UaFx.Advanced | v2.5–v2.59 |
