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

TStream.Write

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

Declaration

Source position: classesh.inc line 594

public function TStream.Write(

  const Buffer;

  Count: LongInt

):LongInt; virtual; abstract;

Description

Writeattempts to write Countbytes from Bufferto the stream. It returns the actual number of bytes written to the stream.

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

Writeis an abstract method that is overridden by descendent classes to do the actual writinging.

Errors

Descendent classes that do not allow writing to the stream may raise an exception when Writeis used.

See also

TStream.Read

  

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

TStream.WriteBuffer

  

Writes data from the stream to the buffer