Java tutorial
import java.io.BufferedOutputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; public class MainClass { public static void main(String[] args) throws IOException { DataOutputStream dos = new DataOutputStream( new BufferedOutputStream(new FileOutputStream(new File("temp.tmp")))); for (int i = 0; i < 10; i++) dos.writeInt(i); dos.close(); } }