Close

IRandomAccessStream to Byte Array

Convertir IMemoryRandowAccessStream a byte array  (byte[])  UWP

// This is where the byteArray to be stored.
var bytes = new byte[myMemoryStream.Size];

// This returns IAsyncOperationWithProgess, so you can add additional progress handling
await myMemoryStream.ReadAsync(bytes.AsBuffer(), (uint)myMemoryStream.Size, Windows.Storage.Streams.InputStreamOptions.None);

 

// This is where the byteArray to be stored.
var bytes = new byte[myMemoryStream.Size];

// This returns IAsyncOperationWithProgess, so you can add additional progress handling
await myMemoryStream.ReadAsync(bytes.AsBuffer(), (uint)myMemoryStream.Size, Windows.Storage.Streams.InputStreamOptions.None)

 

Fuente: https://social.msdn.microsoft.com/Forums/en-US/38c6cb85-7454-424f-ae94-32782c036567/irandomaccessstream-to-byte-array?forum=winappswithcsharp

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2024 vladymix | WordPress Theme: Annina Free by CrestaProject.