XsWin32FileStream.Read Method | |
Reads a block of bytes from the stream and writes the data in a given buffer.
Namespace:
XSharp.IO
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax VIRTUAL METHOD Read(
bytes AS BYTE[],
offset AS LONG,
count AS LONG
) AS LONG
public override int Read(
byte[] bytes,
int offset,
int count
)
Request Example
View SourceParameters
- bytes
- Type: Byte
- offset
- Type: Long
The byte offset in array at which the read bytes will be placed. - count
- Type: Long
The maximum number of bytes to read.
Return Value
Type:
LongThe total number of bytes read into the buffer. This might be less than the number of bytes requested if that number of bytes are not currently available, or zero if the end of the stream is reached.
Exceptions Exception | Condition |
---|
ArgumentNullException | array is . |
ArgumentOutOfRangeException | offset or count is negative. |
NotSupportedException | The stream does not support reading. |
IOException | An I/O error occurred. |
ArgumentException | offset and count describe an invalid range in array. |
ObjectDisposedException | Methods were called after the stream was closed. |
Remarks This method calls the Windows ReadFile() function directly.
See Also