跳轉到主要內容
這是讀取資料流所使用的介面。此介面及其所有方法都在用戶端實作。例如,讀取資料流可實作為從檔案讀取資料。

方法

名稱說明
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