public static List<String> readLinesFromReader(final Reader reader) throws IOException {
    final BufferedReader br = new BufferedReader(reader);
    try {
      final List<String> lines = new ArrayList<String>();
      String line;
      while (true) {
        line = br.readLine();
        if (line == null) {
          return lines;
        }
        lines.add(line);
      }
    } finally {
      br.close();
    }
  }
Reads lines of text from the specified {@link Reader}.

@param reader the reader to read lines from
@return a list containing the lines read. This list may be empty if there was no data to read.
@throws IOException if an IO error occurs.
java/zylib/src/main/java/com/google/security/zynamics/zylib/io/StreamUtils.java