MemoryStream.Length Propiedad

Definición

Obtiene la longitud de la secuencia en bytes.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

Valor de propiedad

Longitud de la secuencia en bytes.The length of the stream in bytes.

Excepciones

La secuencia está cerrada.The stream is closed.

Ejemplos

Este ejemplo de código forma parte de un ejemplo más extenso proporcionado MemoryStream para la clase.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())

Se aplica a

Consulte también: