コード例 #1
0
 /** @deprecated unclear closing policy, do not use (to remove in IDEA 14) */
 @SuppressWarnings("UnusedDeclaration")
 public static List<String> loadLines(@NotNull Reader reader) throws IOException {
   BufferedReader bufferedReader = new BufferedReader(reader);
   try {
     return loadLines(bufferedReader);
   } finally {
     bufferedReader.close();
   }
 }
コード例 #2
0
 @NotNull
 public static List<String> loadLines(@NotNull Reader reader) throws IOException {
   List<String> lines = new ArrayList<String>();
   BufferedReader bufferedReader = new BufferedReader(reader);
   try {
     String line;
     while ((line = bufferedReader.readLine()) != null) {
       lines.add(line);
     }
   } finally {
     bufferedReader.close();
   }
   return lines;
 }