Concept
When should you use specialized classes for binary file input?
ComputerScienceOne / File Input
"Using the Scanner class to do file input offers a more abstract interaction with a file. It also uses a buffered input stream for performance. Binary files can still be read using nextByte(). However, when dealing with binary files, the better solution is to use a class that models and abstracts the underlying file. For example, if you are reading or writing an image file, you should use the java.awt.Image class to read and write to files. The JDK and other libraries offer a wide variety of classes to model all kinds of data."
Related Ideas
- How can a Scanner read input from a file?ComputerScienceOne · File Input
- When should data be stored as binary or text files?ComputerScienceOne · Buffered and Unbuffered
- How do you write and read binary data in C?ComputerScienceOne · Closing Files
- When should data be stored in binary or text file format?ComputerScienceOne · Binary vs Text Files
- How can you write binary data to an output file?ComputerScienceOne · File Output