OpcFileReadMethodNode.FileReadExCallback Delegate

Namespace: Opc.UaFx
Assemblies: Opc.UaFx.Advanced.dll

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.

C#

[CLSCompliant(false)]
public delegate byte[] FileReadExCallback(OpcMethodContext context, [OpcArgument("FileHandle", Description = "The file handle associated with the file to read.")] uint fileHandle, [OpcArgument("Length", Description = "The number of bytes to read.")] int length);


Attributes CLSCompliantAttribute


Parameters

context OpcMethodContext

The OpcMethodContext to use when reading data from the file. This instance will be also updated with the outcome of the method call.

fileHandle UInt32

A file handle indicating the access request and thus indirectly the position inside the file.

length 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

Byte[]

Contains the returned data of the file.

Remarks

This method does provide the following OpcResult information: * BadInvalidArgumentThe file handle specified by fileHandle or the SessionId is not known or the length is non-positive. * BadUnexpectedErrorAn unexpected error occurred while reading the file. * BadInvalidStateThe file was not opened for read access.