MemoryStream.Length Vlastnost

Definice

Získá délku datového proudu v bajtech.

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

Hodnota vlastnosti

Délka datového proudu v bajtech.

Výjimky

Stream je zavřený.

Příklady

Tento příklad kódu je součástí většího příkladu uvedeného pro třídu 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}", _
    memStream.Capacity.ToString(), _
    memStream.Length.ToString(), _
    memStream.Position.ToString())

Platí pro

Viz také