Welcome to the new DelphiDabbler Code Library Documentation.

This is a new site that's currently running on alpha code. There are going to be bugs. If you discover any, please report them on the site's issues page (GitHub account required). Thanks.

Warning: Many URLs are going to change. Refer to the README file to discover which library project's documentation has been completed.

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.