15.10. Binary I/O

Up to this point, we have been discussing and implementing character-based (or ASCII) I/O. The data files we have been working with contain readable character data, which was read from or written to the file a line at a time. Another option when dealing with data persistence is to use what is known as binary I/O, where the data is read from or written to files as individual bytes of data. The advantages of binary I/O include smaller data files, more efficient I/O operations at run time, and files that are "safer" in a sense because they are not human-readable. The disadvantages of binary I/O are that it is somewhat awkward reading character data with binary I/O, and binary files can be platform dependent, making them difficult ...

Get Beginning C# 2008 Objects: From Concept to Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.