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

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

本文整理了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

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

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

  1. /** Write a string to a file as UTF-8. The file is closed after the operation.
  2. * @param filename
  3. * @param content String to be written
  4. * @throws IOException
  5. */
  6. public static void writeStringAsUTF8(String filename, String content) throws IOException {
  7. try ( OutputStream out = IO.openOutputFileEx(filename) ) {
  8. writeStringAsUTF8(out, content) ;
  9. out.flush() ;
  10. }
  11. }

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

  1. /** Write a string to a file as UTF-8. The file is closed after the operation.
  2. * @param filename
  3. * @param content String to be writtem
  4. * @throws IOException
  5. */
  6. public static void writeStringAsUTF8(String filename, String content) throws IOException {
  7. try ( OutputStream out = IO.openOutputFileEx(filename) ) {
  8. writeStringAsUTF8(out, content) ;
  9. out.flush() ;
  10. }
  11. }

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

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

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

  1. /** Write a string to a file as UTF-8. The file is closed after the operation.
  2. * @param filename
  3. * @param content String to be writtem
  4. * @throws IOException
  5. */
  6. private /*public*/ static void writeStringAsUTF8(String filename, String content) throws IOException {
  7. try ( OutputStream out = IO.openOutputFileEx(filename) ) {
  8. writeStringAsUTF8(out, content) ;
  9. out.flush() ;
  10. }
  11. }

相关文章