Skip to content

LiteObject/Demo.Stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Streams in C#

  • Stream is the abstract base class of all streams.
  • A stream is an abstraction over a sequence of bytes.
  • Streams are classified as either byte streams or character streams.
  • Streams involve three fundamental operations:
    • You can read from streams. Reading is the transfer of data from a stream into a data structure, such as an array of bytes.
    • You can write to streams. Writing is the transfer of data from a data structure into a stream.
    • Streams can support seeking. Seeking refers to querying and modifying the current position within a stream.

Some of the classes

  • Byte streams
    • FileStream
    • MemoryStream
    • BufferedStream
  • Character streams
    • TextReader
    • TextWriter
    • StreamReader
    • StreamWriter

What is a buffer?

A buffer represents a block of bytes in memory where you can temporarily store transient data.

A buffer helps in minimizing the number of calls your application makes to read and write data from and to the file system.

MemoryStream vs BufferedStream

BufferedStream is a class that provides buffering functionality to improve the performance of read and write operations on other streams.

MemoryStream is a class that represents a stream backed by a block of memory, allowing you to read from or write to the memory as if it were a stream.


Links

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages