When I wrote some I / O routine to C++, I usually made it as general as possible, working on interfaces from <iostream>.
For instance:
void someRoutine(std::istream& stream) { ... }
How to do it in C#?
I suspect that I can write my routines based on System.IO.TextReaderor System.IO.TextWriter, but I'm not sure.
Obviously, I am looking for the same base class in C#, which is common as std::istreamor std::ostreamthat can be extended in many ways (for example, as it boost::iostreamsextends std::threads).
source
share