/***** Code de MesExemples.com *******/
import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
class WriteIntToFile {
public static void main(String[] args) {
String strFilePath = "C://test.txt";
try
{
FileOutputStream fout = new FileOutputStream(strFilePath);
DataOutputStream dos = new DataOutputStream(fout);
int i = 100;
dos.writeInt(i);
dos.close();
}
catch (IOException e)
{
System.out.println("IOException : " + e);
}
}
}