![]() |
VOOZH | about |
As we know whenever it comes to writing over a file, write() method of the File class comes into play but here we can not use it in order to convert that byte into a file. In order to convert a byte array to a file, we will be using a method named the getBytes() method of String class.
Implementation: Convert a String into a byte array and write it in a file.
Example:
Output: On console
Successfully byte inserted
Now let us also discuss the use-case in order how to write Integer, Double, Character Values in the File (using Wrapper Class)
Example:
Output: On console
Successfully byte inserted