MemoryStream.Length Propriedade

Definição

Obtém o tamanho do fluxo em 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 da propriedade

Int64

O comprimento do fluxo em bytes.

Exceções

O fluxo está fechado.

Exemplos

Este exemplo de código faz parte de um exemplo maior fornecido para a MemoryStream classe.

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

Aplica-se a

Confira também