[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'Classes' (#rtl)

TStream.Read

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

Declaration

Source position: classesh.inc line 593

public function TStream.Read(

  var Buffer;

  Count: LongInt

):LongInt; virtual; abstract;

Description

Readattempts to read Countfrom the stream to Bufferand returns the number of bytes actually read.

This method should be used when the number of bytes is not determined. If a specific number of bytes is expected, use TSTream.ReadBufferinstead.

Readis an abstract method that is overridden by descendent classes to do the actual reading.

Errors

Descendent classes that do not allow reading from the stream may raise an exception when the Readis used.

See also

TStream.Write

  

Writes data from a buffer to the stream and returns the number of bytes written.

TStream.ReadBuffer

  

Reads data from the stream to a buffer