I'm converting an UWP app to a .NET Maui, but having an issue with FileStream. Here is my working code in the UWP app:
private async static Task<Stream> GetBinaryStream(string binaryFile)
{
var storageFile = await Package.Current.InstalledLocation.GetFileAsync(binaryFile);
var storageStream = await storageFile.OpenSequentialReadAsync();
return storageStream.AsStreamForRead();
}
I've tried multiple implementations, but I can't find an alternative to the line:
var storageStream = await storageFile.OpenSequentialReadAsync();
How do I replicate the UWP code to work with Maui?