import java.io.*;
class Example8_6{
   public static void main(String args[]){
      int b;
      byte buffer[]=new byte[100];
      try{
          System.out.println("输入一行文本,并存入磁盘");        //把从键盘敲入的字符存入buffer
         b=System.in.read(buffer);	  
         FileOutputStream writefile=new FileOutputStream("a.txt"); //通过流把buffer 写入到文件a.txt
         writefile.write(buffer,0,b);	  .
      }
      catch(IOException e){
        	System.out.println("Error ");
      }
   }
}
