package com.v512.zx;
import java.io.*;
public class TestFileInputStream {
public static void main(String[] args) {
FileInputStream in = null;
int i = 0;
try {
in = new FileInputStream("E:
workspace
6.0
zx
src
com
v512
zx
haha.txt");
} catch (FileNotFoundException e) {
System.out.println("系统找不到指定的文件。");
System.exit(-1);
}
try{
long num = 0;
while((i=in.read()) != -1){
System.out.println((char)i);
num++;
in.close();
}
} catch (IOException e) {
System.out.println("读取失败。");
System.exit(-1);
}
}
}
控制台输出
f
读取失败。why?
|
|