MemoryStream.Position プロパティ

定義

ストリームの現在位置を取得または設定します。

public:
 virtual property long Position { long get(); void set(long value); };
public override long Position { get; set; }
member this.Position : int64 with get, set
Public Overrides Property Position As Long

プロパティ値

ストリーム内の現在位置。

例外

位置は負の値または Int32.MaxValue より大きい値に設定されます。

ストリームは閉じられています。

このコード例は、MemoryStream クラスのために提供されている大規模な例の一部です。

// Write the stream properties to the console.
Console::WriteLine( "Capacity = {0}, Length = {1}, "
"Position = {2}\n", memStream->Capacity.ToString(), memStream->Length.ToString(), memStream->Position.ToString() );
// Write the stream properties to the console.
Console.WriteLine(
    "Capacity = {0}, Length = {1}, Position = {2}\n",
    memStream.Capacity.ToString(),
    memStream.Length.ToString(),
    memStream.Position.ToString());
' Write the stream properties to the console.
Console.WriteLine( _
    "Capacity = {0}, Length = {1}, Position = {2}", _
    memStream.Capacity.ToString(), _
    memStream.Length.ToString(), _
    memStream.Position.ToString())

適用対象

こちらもご覧ください