hi to all
can any one explain about streams or can suggest best articles
thank you
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rekha SinghRank #1,571 · 1K reputationPosted Jan 6, 2010, 2:37 AM EST
Streamclass forms the abstract class of all other streams. That is, you cannot directly create an instance of theStreamclass. Instead, theStreamclass is implemented by the following classes:BufferedStream: provides a buffering layer on another stream to improve performance.FileStream: provides a way to read and write files.MemoryStream: provides a stream using memory as the backing store.NetworkStream: provides a way to access data on the network.CryptoStream: provides a way to supply data for cryptographic transformation.Streams fundamentally involve the following operations:
Namespace: System.IO
Example:
for creating a file
FileStream file = new FileStream("c://test.txt",FileMode.Open,FileAccess.Write); StreamWriter sw = new StreamWriter(file); sw.Write("Hello file system world!"); sw.Close(); Reading from a fileFileStream file = new FileStream("c://test.txt",FileMode.Open,FileAccess.Read); StreamReader sr = new StreamReader(file); string s = sr.ReadToEnd(); sr.Close(); file.Close();srinivas137 reputationPosted Jan 6, 2010, 2:40 AM EST
thank you
Lalit MRank #1,186 · 1.5K reputationPosted Jan 6, 2010, 2:49 AM EST
Modern languages like C, C++ and C# tend to avoid having this and instead implement input and output via library functions. Output involves sending a stream of byte to a device and whether that device is the screen, an object in memory, a file on disk, another computer on a network or a printer is unimportant. The same routines can be used with different destinations. In earlier languages you needed separate routines to handle each device. Streams make this flexibility possible.
show also this articles
http://www.aspfree.com/c/a/C-Sharp/C-Sharp-FileStream-Explained/
http://www.c-sharpcorner.com/UploadFile/Ashish1/memorystream10272005214644PM/memorystream.aspx
http://www.c-sharpcorner.com/UploadFile/mahesh/FileStreamReadorWriteDataStreams12022005072329AM/FileStreamReadorWriteDataStreams.aspx