❔ ✅ SreamReader vs. TextReader
Given i want to program a reader that is efficient so i will read by a character not by line or whole text file should i use stream or text reader i know from docs that TextReader -> StreamReader and they both have function .read() so how should i decide which one.
And should i use a cobination with stringbuilder when i want to count the number of words
4 Replies
TextReader is an abstract class so you can't use it directly
And StreamReader inherits from TextReader actually
So SR is just a realization of TR
If you want it to be efficient, you’ll want to read from disk in buffers, usually 4096 bytes
by char will do
thanks
!close
Closed!
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.