public class Iotest {
public static void main(String args[]) throws IOException{
int s=5;
FileOutputStream fo =new FileOutputStream("E:\\ty.txt");

DataOutputStream fw =new DataOutputStream(fo);
try {

fw.writeInt(s);

fw.flush();
fw.close();

} catch (IOException e) {

e.printStackTrace();
}
}

}这个应该在文件里把数字5写进去。怎么写进去的确是5对应的ASCII码啊。DataOutputStream不是直接可以写进去数字的吗