本文整理了Java中org.apache.uima.util.FileUtils.reader2String()
方法的一些代码示例,展示了FileUtils.reader2String()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.reader2String()
方法的具体详情如下:
包路径:org.apache.uima.util.FileUtils
类名称:FileUtils
方法名:reader2String
[英]Read a bufferedReader into a string, using the default platform encoding.
[中]使用默认平台编码将bufferedReader读入字符串。
代码示例来源:origin: apache/uima-uimaj
/**
* Read the contents of a file into a string, using the default platform encoding.
*
* @param file
* The file to be read in.
* @return String The contents of the file.
* @throws IOException
* Various I/O errors.
*/
public static String file2String(File file) throws IOException {
return reader2String(new FileReader(file));
}
代码示例来源:origin: apache/uima-uimaj
/**
* Read the contents of a file into a string using a specific character encoding.
*
* @param file
* The input file.
* @param fileEncoding
* The character encoding of the file (see your Java documentation for supported
* encodings).
* @return String The contents of the file.
* @throws IOException
* Various I/O errors.
*/
public static String file2String(File file, String fileEncoding) throws IOException {
if (fileEncoding == null) { // use default
return file2String(file);
}
return reader2String(new InputStreamReader(new FileInputStream(file), fileEncoding));
}
代码示例来源:origin: org.apache.uima/uimaj-v3migration-jcas
} else {
v2Source = FileUtils.reader2String(Files.newBufferedReader(p));
cc = sourceToCommonConverted.get(v2Source);
if (null == cc) {
内容来源于网络,如有侵权,请联系作者删除!