January 2011
Intermediate to advanced
1648 pages
70h 30m
English
BinaryReader and BinaryWriterTo go beyond raw byte sequences when dealing with I/O data, the BCL designers invented the BinaryReader and BinaryWriter classes. Just as StreamReader and StreamWriter can be constructed by passing in a Stream object to a constructor, this abstraction simplifies the use of streams by providing additional methods. For example, where StreamReader concerns itself with the notion of textual data and provides a ReadLine method, the BinaryReader class exposes Read methods for various primitive multibyte data types.
Let’s look at an example, again using binary files:

First of all, notice the use of using blocks to ensure ...
Read now
Unlock full access