0 valutazioniIl 0% ha trovato utile questo documento (0 voti)
52 visualizzazioni2 pagine
Binary files store data in its native binary format, which takes less space and is faster to read/write than text files that must convert data to/from text strings. While text files are easier for humans to read, binary files are more efficient for computer storage and processing of data as they avoid the overhead of conversion between binary and text representations.
Binary files store data in its native binary format, which takes less space and is faster to read/write than text files that must convert data to/from text strings. While text files are easier for humans to read, binary files are more efficient for computer storage and processing of data as they avoid the overhead of conversion between binary and text representations.
Binary files store data in its native binary format, which takes less space and is faster to read/write than text files that must convert data to/from text strings. While text files are easier for humans to read, binary files are more efficient for computer storage and processing of data as they avoid the overhead of conversion between binary and text representations.
Binary is faster. Consider an integer stored in 32 bits
(4 bytes), such as 123456. If you were to write this out as binary (which is how it is represented in the computer) it would take 4 bytes (ignoring padding between items for alignment in structures). To write the number as text, it has to be converted to a string of characters (some overhead to convert and memory to store) and then written it out, it will take at least 6 bytes as there are 6 characters to respresent the number. This is not including any additional padding such as spaces for alignment or delimiters to read/seperate the data. Now if you consider it you had several thousands of items, the additional time can add up and require more space, which would take longer to read in and then there is the additonal time to convert back to binary for storage after you have read the value into memory. The advantage to text, is that it is much easier to read for persons, rather then trying to read binary data
These files are designed to store text and thus all
values that are input or output from/to them can suffer some formatting transformations, which do not necessarily correspond to their literal binary value.