/** Конструктор по умолчанию */ public FormatXMLWriter() { try { outline = new OutlineXMLWriter(createXMLWriter(System.out)); } catch (XMLStreamException ex) { XMLUtil.fireException(ex); outline = null; } }
public FormatXMLWriter(File file, Charset encoding) throws FileNotFoundException { if (file == null) { throw new IllegalArgumentException("file == null"); } if (encoding == null) { throw new IllegalArgumentException("encoding == null"); } FileOutputStream fout = null; fout = new FileOutputStream(file); Writer wr = new OutputStreamWriter(fout, encoding); try { outline = new OutlineXMLWriter(createXMLWriter(wr)); } catch (XMLStreamException ex) { XMLUtil.fireException(ex); outline = null; } }