Wednesday, 25 April 2012

Beginning .Net : FileStream in .Net

Any type of I/O operation you are performing in .NET, if you want to read or write data you eventually use a stream of some type. Streams are the basic mechanism. .NET uses to transfer data to and from its underlying source, it will be a file, communication pipe, or TCP/IP socket. The Stream class provides the basic functionality to read and write I/O data, but because the Stream class is marked as abstract, you most likely need to use one of the several classes derived from Stream. Each Stream derivation is specialized to make transferring data from a specific source easy.
Here is Table to lists some of the classes derived from the Stream class.

TABLE :

CLASS DESCRIPTION
System.IO.FileStream Reads and writes files on a file system, as well as other file related operating system handles (including pipes, standard input, standard output, and so on).
System.IO.MemoryStream Creates streams that have memory as a backing store instead of a disk or a network connection. This can be useful in eliminating the need to write temporary files to disk or to store binary information in a database.
System.IO.UnmanagedMemoryStream Supports access to unmanaged memory using the existing stream-based model and does not require that the contents in the unmanaged memory be copied to the heap.
System.IO.BufferedStream Extends the Stream class by adding a buffering layer to read and write operations on another stream. The stream performs reads and writes in blocks (4096 bytes by default), which can result in improved efficiency.
System.Net.Sockets.NetworkStream Implements the standard .NET Framework stream to send and receive data through network sockets. It supports both synchronous and asynchronous access to the network data stream.
System.Security.Cryptography.CryptoStream Enables you to read and write data through cryptographic transformations.
System.IO.Compression.GZipStream Enables you to compress data using the GZip data format.
System.IO.Compression.DeflateStream Enables you to compress data using the Deflate algorithm.
System.Net.Security.NegotiateStream Uses the Negotiate security protocol to authenticate the client,and optionally the server, in client-server communication.
System.Net.Security.SslStream Necessary for client-server communication that uses the Secure Socket Layer (SSL) security protocol to authenticate the server and optionally the client.

No comments:

Post a Comment