What are binary files used for
This might happen accidentally if the data in the file just happened to correspond to those characters. But this would be very rare. Most digital data is stored in binary files. There are several reasons why binary files are used. Input and output are much faster using binary data. Converting a bit integer to characters takes time.
Not a great deal of time, but if a file such as an image file contains millions of numbers the accumulated conversion time is significant. Computer games would slow to a crawl if their data were stored in character form.
A binary file is usually very much smaller than a text file that contains an equivalent amount of data. For image, video, and audio data this is what are binary files used for. Small files save storage space, can be transmitted faster, and are processed faster.
A DVD would not have room enough to store a movie if the data were stored in character format. Some kinds of data can't easily be represented as characters. For example, the bytecodes of a Java class file or the machine language of an executable file. You may not usually think of this as data, but of course, it is. The Java compiler reads an input file a source file and writes a binary data file containing its results the bytecode file.
And almost never is a human going to look at the individual data samples, so there is no reason to make it human-readable. For example, humans look at the entire picture of a GIF file, and have little interest in looking at the individual pixels as numbers. Sometimes a programmer or scientist needs to do this, perhaps for debugging or scientific measurements. But these special occasions can use hex dumps or other specialized programs.
Files can be compressed with a utility program like Zip. Often a text file can be compressed to less than half its original size. Why Binary Files are Needed Most digital data is stored what are binary files used for binary files.
Can the compressed what are binary files used for file be read with a FileReader stream?