Write one byte to a file in Java
Description
The following code shows how to write one byte to a file.
Example
/* w w w .java 2 s .c o m*/
import java.io.FileOutputStream;
public class Main {
public static void main(String[] args) throws Exception {
FileOutputStream fos = new FileOutputStream("C:/demo.txt");
byte b = 01;
fos.write(b);
fos.close();
}
}