62,623
社区成员
发帖
与我相关
我的任务
分享
import java.io.*;
public class test {
public static void main(String[] args) {
// TODO Auto-generated method stub
int b;
byte buffer[]=new byte[2500];
try
{
FileInputStream readfile=new FileInputStream("test.txt");
b=readfile.read(buffer,0,2500);
try
{
String str=new String(buffer,0,b,"Default");
System.out.println(str);
}
catch(UnsupportedEncodingException uio){System.out.println("uio error");}
}
catch(IOException ioe){ioe.printStackTrace();} //这样就知道是不是找不到文件了,应该是找不到文件的问题
}
}