Search

Browse by Category
 
 
Hide Left Column
< Return to Safari Guides Main Page

Safari Guides

Topic: .NET

Using streams in C#

For many applications, data is held in memory and accessed as if it were a three-dimensional solid; when you need to access a variable or an object, use its name--and, presto, it is available to you. When you want to move your data into or out of a file, across the network, or over the Internet, however, your data must be streamed. In a stream, data flows much like bubbles in a stream of water.

Cover GraphicFor details on reading a web page as an HTML stream read Section 21.5 of Programming C#, 4th Edition from O'Reilly Media.

When you are first learning the .NET Framework the proper way to read to, write from, or otherwise interact with files can be unclear because the framework provides so many different ways of attacking this problem. The solution is to use file streams to perform various file functions. There are five basic types of built-in file stream manipulation classes that you can use in order to read and/or write to the file stream.

Cover GraphicRead Recipe 11.5 of C# Cookbook from O'Reilly Media for details on choosing a method of opening a file or stream for reading and/or writing using C#.


Company | Terms of Service | Privacy Policy | Contact Us | Help | 508 Compliance
Copyright © 28-N Safari Books Online. All rights reserved.