Code example for OutputStream

Methods: close, flush

0
     * {@inheritDoc} 
     */ 
    @Override 
    public <T> void writeTo(OutputStream out, T obj, Schema<T> schema) throws IOException {
        try { 
            XmlIOUtil.writeTo(out, obj, schema);
            out.flush();
        } finally { 
            if (isCloseEnabled()) { 
                out.close();
            } 
        } 
    } 
 
    /** 
     * {@inheritDoc} 
     */ 
    @Override 
    public <T> void mergeFrom(InputStream in, T obj, Schema<T> schema) throws IOException {
        try { 
            XmlIOUtil.mergeFrom(in, obj, schema);