Chinese Simplified (简体中文)

Read Method of the IReadStream Interface

This method is implemented on the client-side and is used to input the data for processing from a custom source. Your implementation of this method should create a data array and pass control over it to the caller, who is then responsible for the freeing its memory after use.

Syntax

HRESULT Read(
  SAFEARRAY(BYTE)* Data,
  int              Count,
  int*             BytesRead
);
    

Parameters

Data
[out] This parameter refers to the data to be read. Your implementation of this method should create this array and write the required data into it. The caller is responsible for releasing this memory when no longer needed.
Count
[in] This parameter specifies the upper limit to the number of bytes to be read.
BytesRead
[out, retval] This parameter specifies the number of bytes that were actually read (that is, the size of memory taken up by the Data buffer). If this number is greater than 0, the method will be called again until this parameter returns 0.

Return values

[C++ only] If this method returns a value other than S_OK, this indicates that an error occurred on the client-side.

Remarks

The client implementation of this method must assure that all exceptions thrown inside the method are caught and handled and no exceptions are propagated outside the method. Propagation of an exception outside the method may lead to unpredictable results (such as program termination).  

See also

IReadStream

03.07.2024 8:50:10

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.