May 2010
Intermediate to advanced
1272 pages
61h 18m
English
You can read and write data to binary files using the BinaryReader and BinaryWriter classes. Both require a FileStream instance and allow reading and writing arrays of bytes. The following is an example of creating a binary stream:

The Write method allows writing information as binary but it also accepts base .NET types such as integers and strings, all written as binary. It provides several overloads so that you can also specify the offset and the number of bytes to be written. To read a binary file you instantiate the BinaryReader class. The following example retrieves information from a file utilizing a Using..End ...
Read now
Unlock full access