Summary

TGetDataFunc is used as a user implemented callback function, which is used in NG.Serialization.TBinaryData.

Syntax

TGetDataFunc = reference to function(out ABuffer;
                                       ACount: Integer): Integer;

Parameters

ABuffer

Type: Void Type

Output buffer, which should be filled with binary data.
ACount

Type: Integer

The length of ABuffer in bytes.

Return Value

Type: Integer

The function should return actually written bytes count, or zero, if no bytes has been written.

Remarks

The implementation of TGetDataFunc can be called by NG.Serialization.TBinaryData several times. It should provide the next piece of data at each call. The implementation should not exceed ABuffer size, specified in ACount parameter. At the same time the implementation should provide as much data as possible; Thus, the return value can be less than ACount only for the last data chunk.