大虾~~~求救~~! 应该不是路径的问题,我的别的程序都可以通过的,可能是我的fileReader的方法用错了,请问怎么样可以用fileReader()把数据从文件中导入?谢谢各位了~~!!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 import java.io.*;public class IODemo{ public static void main(String[] args) throws IOException{ BufferedReader in=new BufferedReader(new FileReader("page1.htm"));//文件路径 String s,s2=new String(); char c; while((s=in.readLine())!=null) s2+=s+"\n"; in.close(); s2 = new String( s2.getBytes( "ISO8859_1")); try{ DataInputStream in2=new DataInputStream(new ByteArrayInputStream(s2.getBytes())); while(true){ c=(char)in2.readByte(); System.out.print(c); } } catch(EOFException e){ System.err.println("End of stream"); } }} socket编程并连接数据库问题!! 请来看一下,帮帮忙!! 如何查看编译器优化字符串的加操作? 万年历谁会做;请高手指点; 关于线程run()方法中的异常 关于读取代理服务器的配置信息 java如何实现将多个媒体文件合并为一个媒体文件? 关于java多线程问题,高手请进 请教下java的异常抛出的用处???? 急向java高手请教和!!!!!!!!!!!! Java里引用类型的引用 对象名 而对 8大基础类声明的变量产生的疑问: *******高手请问: 如何在自己的方法内 画图????*****哪位高手知道 java打印问题
public static void main(String[] args) throws IOException{
BufferedReader in=new BufferedReader(new FileReader("page1.htm"));//文件路径
String s,s2=new String();
char c;
while((s=in.readLine())!=null)
s2+=s+"\n";
in.close();
s2 = new String( s2.getBytes( "ISO8859_1"));
try{
DataInputStream in2=new DataInputStream(new ByteArrayInputStream(s2.getBytes()));
while(true){
c=(char)in2.readByte();
System.out.print(c);
}
}
catch(EOFException e){
System.err.println("End of stream");
}
}
}