跳转到主要内容
这是读取流的接口。此接口及其所有方法均在客户端实现。例如,读取流可以实现为从文件中读取。

方法

名称说明
Close结束对流的使用,并可释放所有已分配的资源。
Read从流中读取指定数量的字节。

输入参数

此对象作为输入参数传递给以下方法:

示例

class ReadStream : IReadStream
{
 private MemoryStream fileBytes = null;
 public ReadStream( byte[] _fileBytes )
 {
  fileBytes = new MemoryStream( _fileBytes );
 }
 public void Close()
 {
  fileBytes.Close();
 }
 public int Read( out byte[] data, int count )
 {
  data = new byte[count];
  int readBytes = fileBytes.Read( data, 0, count );
  return readBytes;
 }
}

备注

在 Linux 中,如果 Engine 对象以进程外服务器的方式加载,则此接口无法使用。

另请参见

FRDocument IWriteStream IFileWriter