ReadDiskStream

Reads from a disk stream.

Synopsis

int32 ReadDiskStream( Stream *theStream, char *buffer,int32 nBytes )

Description

This routine transfers the specified number of bytes (or, as many as are left before the end-of-file) from the stream (beginning at the stream's current position) to the specified buffer. It advances the stream position past the bytes that have been transferred, and returns the actual number of bytes transferred. It will initiate an asynchronous read to read additional data into the stream's internal buffer, if possible and appropriate.

Arguments

theStream
A pointer to the stream structure from which to read.
buffer
A pointer to the buffer into which to read the data.
nBytes
The number of bytes to read.

Return Value

The function returns the actual number of bytes read or a negative error code if an error occurs.

Implementation

Folio call implemented in file folio V20.

Associated Files

filestreamfunctions.h, filesystem.lib

See Also

CloseDiskStream(), OpenDiskStream(), SeekDiskStream()