KristofferStrube/Blazor.FileSystemAccess

How to get a StreamReader

igngi opened this issue · 1 comments

Hi, I'm trying to use FileSystemAccess to read a big csv file and I need a StreamReader. I saw that I can get a ReadableStream using GetFileStream but I can't figure out how to convert that into a StreamReader.

Any help will be appreciated.

Thanks!

Hey @igngi, I recommend that you simply use the native StreamReader implementation from the Blazor. Streams library, where the ReadableStream implementation lives.

I recommend this because the ReadableStream is very limited meaning you can't seek and you can't invoke synchronous stream methods. I have an open issue here that also touches on what we need to get to a place where it would be easier for the ReadableStream implementation to be consumable by the .NET Standard implementation of a StreamReader: KristofferStrube/Blazor.Streams#3

I also recommend that you explore the demo pages related to ReadableStream from the Blazor.Streams library to see what use cases fit your needs: https://kristofferstrube.github.io/Blazor.Streams/