C
Chris
I'm reading up on streams and I have two articles that
seem to conflict with each other. One article describes
streams and lists a few of the major ones (FileStream,
Memory Stream, Network Stream, etc.). It then goes on to
discuss the restriction that streams only read bytes or
byte arrays that the .net framework provides a
StreamReader and StreamWriter class to do type conversions
to and from bytes when using streams.
The second article describes the StreamReader and
StreamWriter class as streams themselves and demonstrates
them using the File class object to open a file and
read/write to it using the returned StreamReader and
StreamWriter objects of the static file methods.
So what is technically correct? Are the StreamReader and
StreamWriter classes actually streams or just wrapper
classes for converting data to and from bytes? Do we
actaully ever deal with streams directly or is it our use
of the StreamReader and StreamWriter that gives us access
to the "actual" stream objects?
I hope this is an interesting thought for someone to
ponder.
Thanks, Chris
seem to conflict with each other. One article describes
streams and lists a few of the major ones (FileStream,
Memory Stream, Network Stream, etc.). It then goes on to
discuss the restriction that streams only read bytes or
byte arrays that the .net framework provides a
StreamReader and StreamWriter class to do type conversions
to and from bytes when using streams.
The second article describes the StreamReader and
StreamWriter class as streams themselves and demonstrates
them using the File class object to open a file and
read/write to it using the returned StreamReader and
StreamWriter objects of the static file methods.
So what is technically correct? Are the StreamReader and
StreamWriter classes actually streams or just wrapper
classes for converting data to and from bytes? Do we
actaully ever deal with streams directly or is it our use
of the StreamReader and StreamWriter that gives us access
to the "actual" stream objects?
I hope this is an interesting thought for someone to
ponder.
Thanks, Chris