2进制的最好用过滤的IO流如:try{DataOutputStream ouput=new DataOutputStream(new FileOutputStream("text.dat"));int temp=1;output.writeInt(temp);output.close();}catch(IOException ioex){}