in.data中的数据"28.7812 34.4632 31.3381 31.2834..."File fileIn=new File("in.data");
//File fileOut=new File("out.data");
if(fileIn.exists()){
System.out.println("the file's path:"+fileIn.getPath());
System.out.println("the directory is "+fileIn.getParent());
}
else
System.out.println("no file");
FileReader fr=new FileReader(fileIn);
StreamTokenizer stk=new StreamTokenizer(fr);
if(stk.nextToken()==StreamTokenizer.TT_NUMBER){
System.out.println("yes a number");
System.out.println("value is "+stk.nval);
}即可读入数据。nextToken原来只是返回该token的类型。In DataInputStream the readDouble() 好像只是对用DataOutputStream 的 writeDouble()写入的数据读出有用?写入是用unicode编码的么
转载于:https://blog.51cto.com/dongdong1314/78834