In the previous section, the readSize.go utility illustrated how you can read a file byte by byte, which is a technique that best applies to binary files. So, you might ask, why read data in binary format when text formats are so much easier to understand? The main reason is space reduction. Imagine that you want to store the number 20 as a string to a file. It is easy to understand that you will need two bytes to store 20 using ASCII characters: one for storing 2 and another for storing 0.
Storing 20 in binary format requires just one byte, since 20 can be represented as 00010100 in binary or as 0x14 in hexadecimal.
This difference might look insignificant when you are dealing with small amounts of data, but it could be pretty substantial when dealing with data found in applications such as database servers.