Ejemplo n.º 1
0
 public async Task<byte[]> LoadAsync(string filePath)
 {
     StorageFile currentStorage = await GetFileAsync(filePath, CreationCollisionOption.OpenIfExists);
     using (IRandomAccessStream readStream = await currentStorage.OpenAsync(FileAccessMode.Read))
     {
         using (DataReader dataReader = new DataReader(readStream))
         {
             await dataReader.LoadAsync((uint)readStream.Size);
             return dataReader.GetBytes();
         }
     }
 }