简体   繁体   中英

Converting any file into binary in java

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

Sounds like you want FileInputStream ! You may find the Basic I/O tutorial useful too.

use FileInputStream

FileInputStream is meant for reading streams of raw bytes such as image data. For reading streams of characters, consider using FileReader.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM