-
Mar 15th, 2018, 04:16 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Reader/writer class VS stream class
What's the difference between a reader/writer class and stream class??
-
Mar 15th, 2018, 05:30 PM
#2
Re: Reader/writer class VS stream class
A Stream literally represents a stream of raw data, i.e. a series of Bytes that flows from a source to a destination. Readers and writers generally sit on top of a something (often a Stream) and translate that data in some way. For instance, the TextReader and TextWriter classes do as their names suggest and all reading and writing of text. The StreamReader and StreamWriter classes inherit TextReader and TextWriter and provide that text reading and writing functionality for Streams. The translation is done from Bytes to text or from text to Bytes using an Encoding. The underlying Stream can be any type, e.g. FileStream, MemoryStream, NetworkStream. This means that you can read text from and write text to a Stream in exactly the same way regardless of what's at the other end.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|