code: public static List<String> appendLines(List<String> result, InputStream inputStream, String encoding)
              throws UnsupportedEncodingException, IOException {
          BufferedReader in = new BufferedReader(new InputStreamReader(inputStream, encoding == null ? "UTF-8" : encoding));
          while (true) {
              String line = in.readLine();
              if (line == null) break;
              result.add(line);
          }
          return result;
      }
docs: Utility for loading lines from a UTF8 file.
  @param result The result of the appended lines.
  @param inputStream The input stream.
  @param encoding if null, then UTF-8
  @return filled list
  @throws IOException  If there were problems opening the input stream for reading.