jre版本太低 用不了nio包
io包里面有很多类,不知道哪个效率最好
生成一个xx.txt文件
然后往这个文件里写东西
会写很多东西
然后再写个程序读这个xx.txt文件

解决方案 »

  1.   

    写雷同
    import java.io.*;public class BufferedInputStreamDemo
    {
     public static void main(String[] args)throws IOException 
     {
      try
      {
       BufferedInputStream bis;
       int b;
       bis = new BufferedInputStream (new FileInputStream (new File ("D://testfile//err.log")));
       try{bis.skip(10);}catch(IOException e){System.out.println(e);}System.out.println ("The content of text is:");
       while ((b = bis.read()) != -1)//顺序读取文件text里的内容并赋值给整型变量b,直到文件结束为止。
       {
        System.out.print((char)b);
       }
       bis.close();
      }
      catch(FileNotFoundException e)
      {
       System.out.println(e);
      }
      catch(IOException e)
      {
       System.out.println(e);
      }
     }
    }
      

  2.   

    BufferedInputStream,BufferedReader
    BufferedOutputStream,BufferedWriter