Summary

FlushBuffer method synchronizes used stream position with really read bytes count.

Syntax

procedure FlushBuffer;

Remarks

For improving performance, NG.Serialization.Binary.TBinaryDeserializer use its own internal buffer; thus real reading from TStream is performed in advance by big chunks. Thus, TStream.Position usually advance more, than the really read bytes count.

Buffer flush is essentially a synchronization of stream object position with really read bytes count. It performed automatically, when the de-serializer object is destroyed, but if TStream.Position is needed to be valid before de-serializer destruction, its required to call FlushBuffer method to synchronize stream position.