org.apache.uima.util.FileUtils.reader2String()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(119)

本文整理了Java中org.apache.uima.util.FileUtils.reader2String()方法的一些代码示例,展示了FileUtils.reader2String()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.reader2String()方法的具体详情如下:
包路径:org.apache.uima.util.FileUtils
类名称:FileUtils
方法名:reader2String

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) {

相关文章