org.apache.jena.atlas.io.IO.openOutputFileEx()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(94)

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

IO.openOutputFileEx介绍

[英]Open an input stream to a file; do not mask IOExceptions. If the filename ends in .gz, wrap in GZIPOutputStream
[中]打开文件的输入流;不要掩盖异常。如果文件名以结尾。gz,用GZIPOutputStream包装

代码示例

代码示例来源:origin: apache/jena

/** Open a file for output - may include adding gzip processing. */
static public OutputStream openOutputFile(String filename) {
  try { return openOutputFileEx(filename) ; }
  catch (IOException ex) { IO.exception(ex) ; return null ; }
}

代码示例来源:origin: apache/jena

/** Write a string to a file as UTF-8. The file is closed after the operation.
 * @param filename
 * @param content String to be written
 * @throws IOException
 */

public static void writeStringAsUTF8(String filename, String content) throws IOException {
  try ( OutputStream out = IO.openOutputFileEx(filename) ) {
    writeStringAsUTF8(out, content) ;
    out.flush() ;
  }
}

代码示例来源:origin: org.seaborne.mantis/dboe-base

/** Write a string to a file as UTF-8. The file is closed after the operation.
 * @param filename
 * @param content String to be writtem
 * @throws IOException
 */

public static void writeStringAsUTF8(String filename, String content) throws IOException {
  try ( OutputStream out = IO.openOutputFileEx(filename) ) {
    writeStringAsUTF8(out, content) ;
    out.flush() ;
  }
}

代码示例来源:origin: org.apache.jena/jena-base

/** Open a file for output - may include adding gzip processing. */
static public OutputStream openOutputFile(String filename) {
  try { return openOutputFileEx(filename) ; }
  catch (IOException ex) { IO.exception(ex) ; return null ; }
}

代码示例来源:origin: org.seaborne.rdf-delta/rdf-delta-base

/** Write a string to a file as UTF-8. The file is closed after the operation.
 * @param filename
 * @param content String to be writtem
 * @throws IOException
 */

private /*public*/ static void writeStringAsUTF8(String filename, String content) throws IOException {
  try ( OutputStream out = IO.openOutputFileEx(filename) ) {
    writeStringAsUTF8(out, content) ;
    out.flush() ;
  }
}

相关文章