Read method

Project: Stream Extension Classes

Unit: PJIStreams

Classes: TPJIStreamWrapper, TPJHandleIStreamWrapper, TPJFileIStream

Applies to: ~>3.0

function Read(pv: Pointer; cb: Longint; pcbRead: PLongint): HResult;
  virtual; stdcall;

Description

Reads a specified number of bytes from the wrapped stream into memory starting at the current seek pointer. The seek pointer is incremented by the number of bytes read.

Parameters:

Returns:

Remarks

If the requested number of bytes are available in the wrapped stream then pv^ receives cb bytes and pcbRead^ is set equal to cb. If there is insufficient data remaining in the wrapped stream to fulfil the request then any remaining bytes are read from the stream into pv^ and pcbRead^ will be less than cb. If the stream is at the end when the request is made then no data is copied into pv^ and pcbRead^ is set to zero.

The buffer pointed to by pv must have capacity of at least cb bytes.