Start a new topic

Reading binary file

Hello, I am trying to read a binary file located on the server (ideally through BinaryReader, for which I have already some useful extension methods), however I found out, that the class FileStream is not present in the DuoCode.

What is the proper way of reading binary files in DuoCode?

Is there any code path so I could use BinaryReader?

1 Comment

DuoCode mscorlib has implementation of BinaryReader (System.IO.BinaryReader) over Stream.

No FileStream is present (it's not relevant in JS world actually), but you can use MemoryStream instead from Byte array for example.

Send array from server to client as base64 or binary content in response body, and use MemoryStream with BinaryReader to read from it.

Hopes this help.

Login or Signup to post a comment