code: public static void main(String[] args) throws IOException {
          InputStream in = args.length > 0 ? new BufferedInputStream(
                  new FileInputStream(args[0])) : System.in;
          PrintStream out = args.length > 1 ? new PrintStream(
                  new BufferedOutputStream(new FileOutputStream(args[1])))
                  : System.out;
          BufferedReader br =
              new BufferedReader(new InputStreamReader(in));
          String line;
          while((line = br.readLine())!=null) {
              if(line.indexOf("#")>0) line=line.substring(0,line.indexOf("#"));
              line = line.trim();
              if(line.length()==0) continue;
              line = ArchiveUtils.addImpliedHttpIfNecessary(line);
              out.println(SURT.fromURI(line));
          }
          br.close();
          out.close();
      }
docs: Allow class to be used as a command-line tool for converting
  URL lists (or naked host or host/path fragments implied
  to be HTTP URLs) to SURT form. Lines that cannot be converted
  are returned unchanged.
  
  
  Read from stdin or first file argument. Writes to stdout or
  second argument filename
  
  @param args cmd-line arguments
  @throws IOException