Summary

This overload of Read method family allows to read binary data from NG.Serialization.TBinaryData instance.

Syntax

function Read(out ABuffer; ACount: Integer): Integer; overload;

Parameters

ABuffer

Type: Void Type

Buffer to read into.
ACount

Type: Integer

Size of ABuffer in bytes.

Return Value

Type: Integer

Read method returns actually read into buffer bytes count, or zero, if no bytes was read.

Remarks

Read method can be called several times, and every time the next chunk of data will be retrieved. Read method always try to provide as much data as possible; so, if Read method return value is less than buffer size, specified by ACount parameter, then its the last data chunk.

Read method is used by TSerializer while serializing provided binary data. While de-serializing, it should be called by the user after getting NG.Serialization.TBinaryData instance from TDeserializer.

Note:

Because NG.Serialization.TBinaryData acts only as a wrapper to real underlaying data, its required to read all data from NG.Serialization.TBinaryData instance before de-serializing next value.

See Also