Unit 'Classes' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#rtl]

TStream.ReadBuffer

Reads data from the stream to a buffer.

Declaration

Source position: classesh.inc line 1295

public procedure TStream.ReadBuffer(

  var Buffer;

  Count: NativeInt

);

procedure TStream.ReadBuffer(

  var Buffer: TBytes;

  Count: NativeInt

); overload;

procedure TStream.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 TStream.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

TStream.Read

  

Reads data from the stream to a buffer and returns the number of bytes read.

TStream.WriteBuffer

  

Writes data from a buffer to the stream.


Documentation generated on: Dec 22 2024