XsBufferedFileStream.Read 方法 | |
Reads a block of bytes from the stream and writes the data in a given buffer.
命名空间:
XSharp.IO
程序集:
XSharp.Core (在 XSharp.Core.dll 中) 版本:2.22 GA
语法 VIRTUAL METHOD Read(
bytes AS BYTE[],
offset AS LONG,
count AS LONG
) AS LONG
public override int Read(
byte[] bytes,
int offset,
int count
)
查看代码参数
- bytes
- 类型:Byte
- offset
- 类型:Int32
The byte offset in array at which the read bytes will be placed. - count
- 类型:Int32
The maximum number of bytes to read.
返回值
类型:
Int32The 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.
异常 异常 | 条件 |
---|
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. |
备注 This method overrides the normal behavior of the FileStream class and reads the data from an inmemory cache, when possible
参见