Jump to content

File and stream I/O in C Sharp

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Gogoplata1234 (talk | contribs) at 15:58, 26 February 2014 (Created page with '<!--- Don't mess with this line! --->{{Unreviewed}} <!--- Replace Subject of my article with the subject, and the ... after is with whatever your subject is. ---...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Template:Unreviewed File, I/O and Stream in C# is ... Files and Stream

In the environment of the Computational World as well as the .Net Framework , files may be defined as the containers of information, which is available to the operating system or the processes of the operating system currently in execution to perform operations on. The most abstract definition of files is :

   Ordered collection of bytes of data with particular name and a specific storage place is known as file. 

What can be the Storage Place for a File ?

A storage place is the space which is allocated to the file for its existence . A storage space has practical existence such as the folder/directory inside the hard disk etc.The directory is the container of one or more files just like a bag which has office file sheet(s). The storage is not limited to only hard drive , it can be removable storage such as cd, dvd , blue-ray, usb stick etc.

Stream

A stream in its simplest, is defined as the sequence of bytes that move to and from the storage medium for reading and writing purposes mainly.

For example, reading the text from the file is done through streaming. As we can’t show the streaming in action, it is better to stick with the definition which focuses on the moving sequence of bytes to and from. The streams are not usually limited to reading and writing from a file, they can be database streams (such as stream returning the unique rows from the records), network stream (downloading a game) etc.

Streaming may also refer to seeking in some cases but not always.This can be explained by seeking for a particular song in our mp4 movie file.

The most common stream classes that our .Net Framework offers are:

FileStream for reading and writing to a file.

IsolatedStorageFileStream for reading and writing to a file in isolated storage.

MemoryStream for reading and writing to memory as the backing store.

BufferedStream for improving performance of read and write operations.

NetworkStream for reading and writing over network sockets.

PipeStream for reading and writing over anonymous and named pipes.

CryptoStream for linking data streams to cryptographic transformations.



References

http://msdn.microsoft.com/en-us/library/k3352a4t%28v=vs.110%29.aspx

Files, I/O and Stream in a nutshell