次の方法で共有


CryptoStream.Read メソッド

現在の CryptoStream からバイト シーケンスを読み取り、読み取ったバイト数の分だけストリーム内の位置を進めます。

Overrides Public Function Read( _
   <InteropServices.In(), _
   Out()> ByVal buffer() As Byte, _   ByVal offset As Integer, _   ByVal count As Integer _) As Integer
[C#]
public override int Read(   [   In,   Out] byte[] buffer,intoffset,intcount);
[C++]
public: int Read(   [   In,   Out] unsigned charbuffer __gc[],intoffset,intcount);
[JScript]
public override function Read(
   buffer : Byte[],offset : int,count : int) : int;

パラメータ

  • buffer
    バイト配列。現在のストリームから count で指定された最大バイト数を読み取り、buffer 内に格納します。
  • offset
    現在のストリームから読み取ったデータの格納を開始する位置を示す、バッファ内のバイト オフセット。
  • count
    現在のストリームから読み取る最大バイト数。

戻り値

バッファに読み取られた合計バイト数。要求されたバイト数を読み取れなかった場合、この値は要求されたバイト数より小さくなることがあります。ストリームの末尾に達していた場合は 0 になります。

例外

例外の種類 条件
NotSupportedException 現在のストリームが読み取り可能ではありません。
ArgumentOutOfRangeException offset パラメータが 0 未満です。

または

count パラメータが 0 未満です。

ArgumentException count パラメータと offset パラメータの合計が、バッファの長さを超えています。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

CryptoStream クラス | CryptoStream メンバ | System.Security.Cryptography 名前空間 | 暗号サービス