code: public static Reader createReader(File file) throws NaaccrIOException {
          InputStream is = null;
          try {
              is = new FileInputStream(file);
  
              if (file.getName().endsWith(".gz"))
                  is = new GZIPInputStream(is);
  
              return new InputStreamReader(is, StandardCharsets.UTF_8);
          }
          catch (IOException e) {
              if (is != null) {
                  try {
                      is.close();
                  }
                  catch (IOException e1) {
                      // give up
                  }
              }
              throw new NaaccrIOException(e.getMessage());
          }
      }
docs: Returns a generic reader for the provided file, taking care of the optional GZ compression.
  @param file file to create the reader from, cannot be null
  @return a generic reader to the file, never null
  @throws NaaccrIOException if the reader cannot be created