BufferedOutputStream: write(int i)
/*
* Output:
*/
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
public class MainClass {
public static void main(String args[]) {
try {
FileOutputStream fos = new FileOutputStream(args[0]);
BufferedOutputStream bos = new BufferedOutputStream(fos);
for (int i = 0; i < 12; i++) {
bos.write(i);
}
bos.close();
} catch (Exception e) {
System.out.println("Exception: " + e);
}
}
}
Related examples in the same category