Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the default values for StreamReader?

I need to use this constructor public StreamReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize, bool leaveOpen) in order to set leaveOpen to true. And in order to do that I need to set the other parameters as well (Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize). I want to use StreamReader as it is so I do not want to give some random values. What are the default values for these parameters?

By the way, I know that I can use StreamReader without using. And GC will get rid of it without touching the stream.

like image 989
Nuri Tasdemir Avatar asked Jul 26 '16 08:07

Nuri Tasdemir


1 Answers

The default values are the following:

  • Encoding: Encoding.UTF8
  • detectEncodingFromByteOrderMarks: true
  • DefaultBufferSize: 1024

You can see the constructors and the values yourself by visiting Reference Source

like image 112
Timo Salomäki Avatar answered Oct 09 '22 22:10

Timo Salomäki