C# Beginner to advanced – Lesson 60 – Stream reader and stream writer (System.IO)



C# Beginner to advanced – Lesson 60 – Stream reader and stream writer (System.IO)

C# Beginner to advanced - Lesson 60 - Stream reader and stream writer (System.IO)

Stream reader and stream writer:
C# includes following standard IO (Input/Output) classes to read/write from different sources like a file, memory, network, isolated storage, etc.
Stream: 
System.IO.Stream is an abstract class that provides standard methods to transfer bytes (read, write, etc.) to the source.
Classes that need to read/write bytes from a particular source must implement the Stream class.
The following classes inherits Stream class to provide functionality to Read/Write bytes from a particular source:
FileStream: reads or writes bytes from/to a physical file whether it is a .txt, .exe, .jpg or any other file. FileStream is derived from the Stream class.
MemoryStream: MemoryStream reads or writes bytes that are stored in memory.
BufferedStream: BufferedStream reads or writes bytes from other Streams to improve the performance of certain I/O operations.
NetworkStream: NetworkStream reads or writes bytes from a network socket.
PipeStream: PipeStream reads or writes bytes from different processes.
CryptoStream: CryptoStream is for linking data streams to cryptographic transformations.

Readers and Writers:
StreamReader: StreamReader is a helper class for reading characters from a Stream by converting bytes into characters using an encoded value. It can be used to read strings (characters) from different Streams like FileStream, MemoryStream, etc.
StreamWriter: StreamWriter is a helper class for writing a string to a Stream by converting characters into bytes. It can be used to write strings to different Streams such as FileStream, MemoryStream, etc.
BinaryReader: BinaryReader is a helper class for reading primitive datatype from bytes.
BinaryWriter: BinaryWriter writes primitive types in binary.

ankpro
ankpro training
Asp.net MVC
C#
C sharp
Bangalore
Rajajinagar
Selenium
Coded UI
Mobile automation testing
Mobile testing
JQuery
JavaScript
.Net
Components of the .Net framework
Hello World
Literal
Keywords
Variable
Data types
Operators
Branching
Loops
Arrays
ArrayList
Strings
String Builder
Structures
Enums
Functions
Classes
Inheritance
Polymorphism
Properties
Indexers
Events
Nested Classes
Delegates
Anonymous methods
Labda expressions
Abstract classes
Exception Handling
Linq
Interfaces
Extension methods
Anonymous types
Generics
Collections
Garbage Collection
Reflection
Attributes
Input and output statements
Type casting
Partial Methods
Partial Classes
Boxing and Unboxing
Var vs Dynamic vs Object
using Static.
Auto property initializer.
Dictionary Initializer.
nameof Expression.
New way for Exception filters.
await in catch and finally block.
Null – Conditional Operator.
Expression – Bodied Methods
Easily format strings – String interpolation
Parameterless constructors in structs.
Creating a custom exceptions class.

Comments are closed.