Sign in Join
FPDoc Onlineexperiment

TStream.ReadBuffer procedure

Member of TStreampublicIn unit Classes

Reads data from the stream to a buffer.

Declaration

pascal
procedure ReadBuffer(var Buffer; Count: NativeInt)
procedure ReadBuffer(var Buffer: TBytes; Count: NativeInt); overload
procedure ReadBuffer(var Buffer: TBytes; Offset: NativeInt; 
 Count: NativeInt); overload

Description

ReadBuffer reads Count bytes of the stream into Buffer. If the stream does not contain Count bytes, then an exception is raised.

ReadBuffer should be used to read in a fixed number of bytes, such as when reading structures or the content of variables. If the number of bytes is not determined, use Read instead. ReadBuffer uses Read internally to do the actual reading.

Errors

If the stream does not allow to read Count bytes, then an exception is raised.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.