IRandomAccessStream to Byte Array
Convertir IMemoryRandowAccessStream a byte array (byte[]) UWP
1 2 3 4 5 |
// 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); |
1 2 3 4 5 |
// 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