io文件輸出流問(wèn)題??運(yùn)行時(shí)為什么提示找不到路徑,不是已經(jīng)創(chuàng)建成功
package imooc;
import java.io.FileOutputStream;
import java.io.IOException;
public class FileOutDemo1 {
?? ?/**
?? ? * @param args
?? ? */
?? ?public static void main(String[] args) throws IOException{
?? ??? ?// TODO Auto-generated method stub
?? ??? ?//如果該文件不存在直接創(chuàng)建,如果存在則刪除后重建
?? ??? ?FileOutputStream out = new FileOutputStream("demo/out.dat");
?? ??? ?out.write('A');
?? ??? ?out.write('B');
?? ??? ?int a = 10;//write只能寫(xiě)八位,寫(xiě)a需要寫(xiě)四次
?? ??? ?out.write(a>>>28);
?? ??? ?out.write(a>>>16);
?? ??? ?out.write(a>>>8);
?? ??? ?out.write(a);
?? ??? ?out.close();
?? ??? ?
?? ??? ?IOUutil.printHex("demo/out.dat");
?? ??? ?
?? ??? ?
?? ??? ?
?? ?}
}
2015-11-12
文件路徑在流中需要雙斜杠。。。你試試吧
2016-10-25
2016-04-09
我剛開(kāi)始也遇到了同樣的問(wèn)題,解決辦法是:先創(chuàng)建一個(gè)demo文件夾
2016-03-16
反了,應(yīng)該用\\
2015-11-12
斜杠反了....是\ ?而且要是雙\\ 用第一個(gè)\來(lái)轉(zhuǎn)義\ ? 別的沒(méi)仔細(xì)看...
2015-11-12
樓主不要急躁,我既然拿了你的積分,我就會(huì)好好滴幫你干活的...
2015-11-12
你這個(gè)是文件是放在哪里的,我看看
2015-11-12
還是不行? 怎么破