IO流(流的标准处理异常代码)

public static void main(String [] args) throws IOException{

  try(

    FileInputStream fis = new FileInputStream ("xxx.txt");

    FileOutputStream fos = new FileOutputStream("yyy.txt"); 

  ){

    int b ;

    while((b = fis.read() ) != -1) {

    fos.write(b);

  }

  }

}

猜你喜欢

转载自www.cnblogs.com/wangffeng293/p/13160147.html