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.
HRESULT Read( SAFEARRAY(BYTE)* Data, int Count, int* BytesRead );
int Read( out byte Data, int Count );
Visual Basic .NET
Function Read( _ ByRef Data() As Byte, _ ByVal Count As Integer _ ) As Integer
- [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.
- [in] This parameter specifies the upper limit to the number of bytes to be read.
- [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.
[C++ only] If this method returns a value other than S_OK, this indicates that an error occurred on the client-side.
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).
3/24/2023 8:51:52 AM