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不是直接可以写进去数字的吗
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不是直接可以写进去数字的吗
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货