Reputation: 11
Anyone know how can I read any file in binary using Java? I want to be able to read any image, document, pdf etc as a stream of binary digits. Thanks
Upvotes: 0
Views: 4279
Reputation: 552
use FileInputStream
FileInputStream is meant for reading streams of raw bytes such as image data. For reading streams of characters, consider using FileReader.
Upvotes: 1
Reputation: 8920
Sounds like you want FileInputStream! You may find the Basic I/O tutorial useful too.
Upvotes: 3