How to use BufferedStream and MemoryStream in C#

How to use BufferedStream and MemoryStream in C#

A stream is an abstraction over a sequence of bytes. You can think of it as a continuous buffer that can be read or written to. Streams are often used in conjunction with buffers to help load data into memory more efficiently. The System.IO namespace in .NET has many classes that work with streams, such as FileStream, MemoryStream, FileInfo, and StreamReader/Writer classes.

Basically, streams are classified as either byte streams or character streams, where byte streams deal with data represented as bytes and character streams deal with characters. In .NET, the byte streams include the Stream, FileStream, MemoryStream, and BufferedStream classes. The .NET character streams include TextReader, TextWriter, StreamReader, and StreamWriter.

To read this article in full, please click here