Code example for OutputStreamWriter

Methods: close

0
    } 
 
    try 
    { 
      final MemoryByteArrayOutputStream bout = new MemoryByteArrayOutputStream();
      final OutputStreamWriter owriter = new OutputStreamWriter(bout);
      IOUtils.getInstance().copyWriter(characterStream, owriter);
      owriter.close();
      return bout.toByteArray();
    } 
    finally 
    { 
      characterStream.close();
    } 
  } 
 
  /** 
   * Parses an XML file which is loaded using the given file. All needed relative file- and resourcespecification are 
   * loaded using the parent directory of the file <code>file</code> as base. 
   * 
   * @param file the report template file.