Last Updated: May 22, 2026
BinaryReader and BinaryWriter are the .NET classes for reading and writing raw bytes that represent primitive types and packed records, instead of human-readable text. They sit on top of any Stream and provide typed Read and Write methods for int, long, double, string, and others. This lesson covers when binary I/O fits over text, exactly how the bytes are laid out on disk, and how to design a small binary record format that round-trips cleanly through both classes.