Skip to content

Latest commit

 

History

History
36 lines (22 loc) · 1.14 KB

TPJIStreamWrapper-Write.md

File metadata and controls

36 lines (22 loc) · 1.14 KB

Write method

Project: Stream Extension Classes

Unit: PJIStreams

Classes: TPJIStreamWrapper, TPJHandleIStreamWrapper, TPJFileIStream

Applies to: ~>3.0

function Write(pv: Pointer; cb: Longint; pcbWritten: PLongint): HResult;
  virtual; stdcall;

Description

Writes a specified number of bytes from memory to the wrapped stream starting at the current seek pointer. The seek pointer is incremented by the number of bytes written.

Parameters:

  • pv -- Pointer to a buffer containing data to be written to the wrapped stream.
  • cb -- Number of bytes to be written.
  • pcbWritten -- Pointer to value that receives number of bytes actually written. May be nil in which case the parameter is ignored.

Returns:

  • S_OK on success.
  • STG_E_CANTSAVE if the stream can't be written to.
  • STG_E_INVALIDPOINTER if pv is nil.

Remarks

If pcbWritten^ is less than cb then not all the data could be written to the wrapped stream.

The buffer pointed to by pv must contain at least cb bytes of data.