Click or drag to resize

XsBufferedFileStream.Read Method

X#
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.19
Syntax
 VIRTUAL METHOD Read(
	bytes AS BYTE[],
	offset AS LONG,
	count AS LONG
) AS LONG
Request Example View Source

Parameters

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: Long
The 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
ExceptionCondition
ArgumentNullExceptionarray is .
ArgumentOutOfRangeExceptionoffset or count is negative.
NotSupportedExceptionThe stream does not support reading.
IOExceptionAn I/O error occurred.
ArgumentExceptionoffset and count describe an invalid range in array.
ObjectDisposedExceptionMethods were called after the stream was closed.
Remarks
This method overrides the normal behavior of the FileStream class and reads the data from an inmemory cache, when possible
See Also