IInputStream.ReadAsync(IBuffer, UInt32, InputStreamOptions) Metodo

Definizione

Legge i dati dal flusso in modo asincrono.

public:
 IAsyncOperationWithProgress<IBuffer ^, unsigned int> ^ ReadAsync(IBuffer ^ buffer, unsigned int count, InputStreamOptions options);
IAsyncOperationWithProgress<IBuffer, uint32_t> ReadAsync(IBuffer const& buffer, uint32_t const& count, InputStreamOptions const& options);
public IAsyncOperationWithProgress<IBuffer,uint> ReadAsync(IBuffer buffer, uint count, InputStreamOptions options);
function readAsync(buffer, count, options)
Public Function ReadAsync (buffer As IBuffer, count As UInteger, options As InputStreamOptions) As IAsyncOperationWithProgress(Of IBuffer, UInteger)

Parametri

buffer
IBuffer

Buffer che può essere utilizzato per restituire i byte letti. Il valore restituito contiene il buffer che contiene i risultati.

count
UInt32

unsigned int

uint32_t

Numero di byte da leggere minore o uguale al valore Capacity .

options
InputStreamOptions

Specifica il tipo dell'operazione di lettura asincrona.

Restituisce

IAsyncOperationWithProgress<IBuffer,UInt32>

Windows.Foundation.IAsyncOperationWithProgress<Windows.Storage.Streams.IBuffer,unsigned int>

IAsyncOperationWithProgress<IBuffer,uint32_t>

Operazione asincrona.

Esempio

Le applicazioni di esempio che usano questo metodo includono l'esempio HttpClient.

Commenti

Legge sempre i dati dal buffer restituito in IAsyncOperationWithProgress(IBuffer, UInt32). Non presupporre che il buffer di input contenga i dati. A seconda dell'implementazione, i dati letti potrebbero essere inseriti nel buffer di input o restituiti in un buffer diverso. Per il buffer di input, non è necessario implementare l'interfaccia IBuffer . È invece possibile creare un'istanza della classe Buffer .

Valutare anche la possibilità di leggere un buffer in un IInputStream usando il metodo ReadBuffer della classe DataReader .

Si applica a

Vedi anche