usr021986 usr021986 - 1 year ago 145
C# Question

Convert StreamReader to byte[]

I am getting the result streamreader object.

I want to convert the result into byte[].

How can i convert streamreader to byte[]?

Thanks

Answer Source

A StreamReader is for text, not plain bytes. Don't use a StreamReader, and instead read directly from the underlying stream.