public XmlOutput createWriter( OutputStream os, String encoding ) throws JAXBException { // UTF8XmlOutput does buffering on its own, and // otherwise createWriter(Writer) inserts a buffering, // so no point in doing a buffering here. if(encoding.equals("UTF-8")) { Encoded[] table = context.getUTF8NameTable(); final UTF8XmlOutput out; CharacterEscapeHandler ceh = createEscapeHandler(encoding); if(isFormattedOutput()) out = new IndentingUTF8XmlOutput(os, indent, table, ceh); else { if(c14nSupport) out = new C14nXmlOutput(os, table, context.c14nSupport, ceh); else out = new UTF8XmlOutput(os, table, ceh); } if(header!=null) out.setHeader(header); return out; } try { return createWriter( new OutputStreamWriter(os,getJavaEncoding(encoding)), encoding ); } catch( UnsupportedEncodingException e ) { throw new MarshalException( Messages.UNSUPPORTED_ENCODING.format(encoding), e ); } }
public XmlOutput createWriter( OutputStream os, String encoding ) throws JAXBException { // UTF8XmlOutput does buffering on its own, and // otherwise createWriter(Writer) inserts a buffering, // so no point in doing a buffering here. if(encoding.equals("UTF-8")) { Encoded[] table = context.getUTF8NameTable(); final UTF8XmlOutput out; CharacterEscapeHandler ceh = createEscapeHandler(encoding); if(isFormattedOutput()) out = new IndentingUTF8XmlOutput(os, indent, table, ceh); else { if(c14nSupport) out = new C14nXmlOutput(os, table, context.c14nSupport, ceh); else out = new UTF8XmlOutput(os, table, ceh); } if(header!=null) out.setHeader(header); return out; } try { return createWriter( new OutputStreamWriter(os,getJavaEncoding(encoding)), encoding ); } catch( UnsupportedEncodingException e ) { throw new MarshalException( Messages.UNSUPPORTED_ENCODING.format(encoding), e ); } }
public XmlOutput createWriter( OutputStream os, String encoding ) throws JAXBException { // UTF8XmlOutput does buffering on its own, and // otherwise createWriter(Writer) inserts a buffering, // so no point in doing a buffering here. if(encoding.equals("UTF-8")) { Encoded[] table = context.getUTF8NameTable(); final UTF8XmlOutput out; if(isFormattedOutput()) out = new IndentingUTF8XmlOutput(os, indent, table, escapeHandler); else { if(c14nSupport) out = new C14nXmlOutput(os, table, context.c14nSupport, escapeHandler); else out = new UTF8XmlOutput(os, table, escapeHandler); } if(header!=null) out.setHeader(header); return out; } try { return createWriter( new OutputStreamWriter(os,getJavaEncoding(encoding)), encoding ); } catch( UnsupportedEncodingException e ) { throw new MarshalException( Messages.UNSUPPORTED_ENCODING.format(encoding), e ); } }
public XmlOutput createWriter( OutputStream os, String encoding ) throws JAXBException { // UTF8XmlOutput does buffering on its own, and // otherwise createWriter(Writer) inserts a buffering, // so no point in doing a buffering here. if(encoding.equals("UTF-8")) { Encoded[] table = context.getUTF8NameTable(); final UTF8XmlOutput out; CharacterEscapeHandler ceh = createEscapeHandler(encoding); if(isFormattedOutput()) out = new IndentingUTF8XmlOutput(os, indent, table, ceh); else { if(c14nSupport) out = new C14nXmlOutput(os, table, context.c14nSupport, ceh); else out = new UTF8XmlOutput(os, table, ceh); } if(header!=null) out.setHeader(header); return out; } try { return createWriter( new OutputStreamWriter(os,getJavaEncoding(encoding)), encoding ); } catch( UnsupportedEncodingException e ) { throw new MarshalException( Messages.UNSUPPORTED_ENCODING.format(encoding), e ); } }