Java tutorial
import java.io.BufferedOutputStream; import java.io.DataOutputStream; import java.io.FileOutputStream; import java.io.IOException; public class Main { public static void main(String[] arguments) { try { FileOutputStream file = new FileOutputStream("p.dat"); BufferedOutputStream buff = new BufferedOutputStream(file); DataOutputStream data = new DataOutputStream(buff); for (int i = 0; i < 400; i++) data.writeInt(i); data.close(); } catch (IOException e) { System.out.println("Error - " + e.toString()); } } }