code: public static BufferedReader createReader(File file) throws IOException {
          InputStream is = new FileInputStream(file);
          if (file.getName().toLowerCase().endsWith(".gz"))
              is = new GZIPInputStream(is);
          return new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8));
      }
docs: Creates a reader from the given file. Support GZIP compressed files.
  @param file file to read
  @return reader