In Brief

This chapter discussed how to work with streams in C#, including these topics:

  • Streams are objects designed to let you handle data transfer. There are many stream classes available, such as FileStream, StreamWriter and StreamReader, NetworkStream, and others.

  • Buffered streams can be created with the BufferedStream class. (If you use a stream like FileStream, you're responsible for setting up your own data buffers.)

  • Binary files can be handled with the FileStream class's Read and Write methods.

  • Text files can be handled with the StreamReader and StreamWriter classes, which support the WriteLine and ReadLine methods, respectively. Unlike the standard Write and Read methods, WriteLine and ReadLine are line-oriented.

  • The .NET Framework supports ...

Get Microsoft® Visual C#® .NET 2003 Kick Start now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.