- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Streams and Byte Streams in C#
A file is a collection of data stored in a disk with a specific name and a directory path. When a file is opened for reading or writing, it becomes a stream.
The type of streams includes −
Byte Streams − It includes Stream, FileStream, MemoryStream and BufferedStream.
Character Streams − It includes Textreader-TextWriter, StreamReader, StraemWriter and other streams.
Byte streams have classes that consider data in the stream as byte.
Stream class is the base for other byte stream classes. The following are the properties −
CanRead − Whether stream supports reading
CanWrite − Whether stream supports writing
Length − Length of the stream
The System.IO namespace has various classes that are used for performing numerous operations with files, such as creating and deleting files, reading from or writing to a file, closing a file etc.
The streams we discussed are described in the below table −
|Sr.No||I/O Class & Description|
Reads primitive data from a binary stream.
Writes primitive data in binary format.
A temporary storage for a stream of bytes.
Helps in manipulating a directory structure.
Used for performing operations on directories.
Provides information for the drives.
Helps in manipulating files.
Used for performing operations on files.
Used to read from and write to any location in a file.
Used for random access to streamed data stored in memory.
Performs operations on path information.
Used for reading characters from a byte stream.
Is used for writing characters to a stream.
Is used for reading from a string buffer.
Is used for writing into a string buffer.
- Byte Streams in Java
- What is the necessity of byte streams and character streams in Java?
- Streams In C#
- Streams in Java
- Character streams in Java
- Java 8 Streams and its operations
- Difference between Streams and Collections in Java 8
- An array of streams in C#
- Streams on Arrays in Java 8
- What are cin, cout and cerr streams in C++?
- Java streams counting() method with examples
- What are Async Streams in C# 8.0?
- How to iterate List Using Streams in Java?
- What is the difference between cerr and clog streams in c++?
- What is the difference between cerr and cout streams in c++?