50,545
社区成员
发帖
与我相关
我的任务
分享
import java.io.File;
import java.io.FileInputStream;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
FileInputStream fis =null;
try{
fis = new FileInputStream ("d:/test/11.txt");
byte [] data = new byte [1024];
int i = 0;
int n = fis.read(data);
String s = new String(data,0,n);
System.out.println(s);
}catch(Exception e){
e.printStackTrace();
}finally{
try{
fis.close();
}catch(Exception e){
System.out.println("exception");
}
}
}
}