NET - Define Stream class in .NET. Explain with an example using C#.NET?

Define Stream class in .NET. Explain with an example using C#.NET.

The Stream class gives a view of various types of input and output. Streams involve three fundamental operations:

1. Read : Transfer of data from stream into a data structure.
2. Write : Transfer of data from a data structure into stream.
3. Seeking : Querying and updating the current position within the stream.

Streams are a medium to read and write data to and from memory, file or other objects.

Example:
System.IO.StreamReader file=new StreamReader(@"abc.txt")
string temp=file.ReadToEnd();
file.close();
NET - Explain common Stream types in Net.
Explain common Stream types in Net - FileStream, MemoryStream, StreamReader, StreamWriter.....
NET - Explain how to compress data with a compression Stream
Explain how to compress data with a compression Stream - Compression streams write to another stream.......
NET - Explain how to Throw and Catch Exceptions in C#.NET
Answer - Explain how to Throw and Catch Exceptions......
Post your comment