Home > Back-end >  IO flows lead to Too many open files
IO flows lead to Too many open files

Time:05-13

Problem: use the stream server display information when Too many open files
Code: try {
,,,
Br1=new BufferedReader (new InputStreamReader (is, "utf-8"));
While ((, line1=br1. ReadLine ())!=null) {
,,,
bw=new BufferedWriter (new OutputStreamWriter (new FileOutputStream (file, true)));
Bw. Write (, line1);
}
bw.flush();
{} the catch (,,,)
,,,
} the finally {bw. The close (); ,,,}

The bw on the loop was assignment the flow object for many times, only in the last finally closed circulation more than the number of times that will not cause Too many open files

  • Related