MemoryStream.Length Propriedade

Definição

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

O comprimento do fluxo em bytes.The length of the stream in bytes.

Exceções

O fluxo está fechado.The stream is closed.

Exemplos

Este exemplo de código faz parte de um exemplo maior fornecido para MemoryStream a classe.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())

Aplica-se a

Veja também