usr021986 usr021986 - 11 months ago 110
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[]?


Answer Source

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