code: public static HostsFileEntries parse(File file, Charset... charsets) throws IOException {
          checkNotNull(file, "file");
          checkNotNull(charsets, "charsets");
          if (file.exists() && file.isFile()) {
              for (Charset charset: charsets) {
                  HostsFileEntries entries = parse(new BufferedReader(new InputStreamReader(
                          new FileInputStream(file), charset)));
                  if (entries != HostsFileEntries.EMPTY) {
                      return entries;
                  }
              }
          }
          return HostsFileEntries.EMPTY;
      }
docs: Parse a hosts file.
  
  @param file the file to be parsed
  @param charsets the {@link Charset}s to try as file encodings when parsing.
  @return a {@link HostsFileEntries}
  @throws IOException file could not be read