java中原始数据文件的输入
生活随笔
收集整理的這篇文章主要介紹了
java中原始数据文件的输入
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
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編碼的么??
??//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
總結
以上是生活随笔為你收集整理的java中原始数据文件的输入的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: IT餐馆—第十六回 驱动
- 下一篇: Something about WinC