O'Reilly logo

Visual Basic 2012 Programmer's Reference by Rod Stephens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix T

Streams

Visual Studio provides several classes that treat data as a stream — an ordered series of bytes. These classes are not difficult to use, but they are similar enough to be confusing. This appendix summarizes the stream classes and describes their properties and their methods. See Chapter 29, “Streams,” for more information on streams.

STREAM CLASS SUMMARY

The following table lists the Visual Studio stream classes. It can provide you with some guidance for selecting a stream class.

CLASS PURPOSE
BinaryReader, BinaryWriter Read and write data from an underlying stream using routines that manage specific data types (such as ReadDouble and ReadUInt16).
BufferedStream Adds buffering to another stream type. This sometimes improves performance on relatively slow underlying devices.
CryptoStream Applies a cryptographic transformation to its data.
FileStream Represents a file as a stream. Usually, you can use a helper class such as BinaryReader or TextWriter to make working with a FileStream easier.
MemoryStream Lets you read and write stream data in memory. This is useful when you need a stream but don’t want to read or write a file.
NetworkStream Sends and receives data across a network connection.
Stream A generic stream class. This is a virtual (MustInherit) class, so you cannot create one directly. Instead, you must instantiate one of its subclasses.
StreamReader, StreamWriter These classes inherit from TextReader and TextWriter. They provide ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required