/** * Creates a {@link CharStream} given a string containing a * path to a file on disk and the charset of the bytes * contained in the file. * * Reads the entire contents of the file into the result before returning. */ public static CharStream fromFileName(String fileName, Charset charset) throws IOException { return fromFile(new File(fileName), charset); }
/** * Creates a {@link CharStream} given a path to a UTF-8 * encoded file on disk. * * Reads the entire contents of the file into the result before returning. */ public static CharStream fromFile(File file) throws IOException { return fromFile(file, Charset.forName("UTF-8")); }
CharStream charStream = CharStreams.fromFile(new File(inputFile), charset); if ( inputFiles.size()>1 ) { System.err.println(inputFile);