MemoryStream.Length MemoryStream.Length MemoryStream.Length MemoryStream.Length Property

定義

バイト単位のストリーム長を取得します。Gets the length of the stream in bytes.

public:
 virtual property long Length { long get(); };
public override long Length { get; }
member this.Length : int64
Public Overrides ReadOnly Property Length As Long

プロパティ値

バイト単位のストリーム長。The length of the stream in bytes.

例外

ストリームは閉じられています。The stream is closed.

このコード例は、 MemoryStreamクラスに対して提供される大規模な例の一部です。This code example is part of a larger example provided for the MemoryStream class.

// 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())

適用対象

こちらもご覧ください