Nguyễn Trần Mai Trang
New member
How do I convert FileOutputStream to a file?
Answer
In Java, FileOutputStream is a bytes stream class that’s used to handle raw binary data. To write the data to file, you have to convert the data into bytes and save it to file. See below full example. An updated JDK7 example, using
new “try resource close” method to handle file easily.
Answer
In Java, FileOutputStream is a bytes stream class that’s used to handle raw binary data. To write the data to file, you have to convert the data into bytes and save it to file. See below full example. An updated JDK7 example, using
new “try resource close” method to handle file easily.