agave-common/common-legacy-api/src/main/java/org/iplantc/service/common/representation/TemplateRepresentation.java
/**
     * Writes the datum as a stream of bytes.
     * 
     * @param outputStream
     *            The stream to use when writing.
     */
Writes the datum as a stream of bytes.

@param outputStream
The stream to use when writing.
Writes the datum as a stream of bytes . @param outputStream The stream to use when writing .
public void write(OutputStream outputStream) throws IOException {
        Writer tmplWriter = null;
        try {
            if (template == null) {
            	template = config.getTemplate(templateName);
            }
            if (getCharacterSet() != null) {
                tmplWriter = new BufferedWriter(new OutputStreamWriter(
                        outputStream, getCharacterSet().getName()));
            } else {
                tmplWriter = new BufferedWriter(new OutputStreamWriter(
                        outputStream, template.getEncoding()));
            }
            template.process(getDataModel(), tmplWriter);
            tmplWriter.flush();
        } catch (TemplateException te) {
            throw new IOException("Template processing error "
                    + te.getMessage());
        }
    }
public void write ( OutputStream outputStream ) throws IOException { Writer tmplWriter = null ; try { if ( template == null ) { template = config . getTemplate ( templateName ) ; } if ( getCharacterSet ( ) != null ) { tmplWriter = new BufferedWriter ( new OutputStreamWriter ( outputStream , getCharacterSet ( ) . getName ( ) ) ) ; } else { tmplWriter = new BufferedWriter ( new OutputStreamWriter ( outputStream , template . getEncoding ( ) ) ) ; } template . process ( getDataModel ( ) , tmplWriter ) ; tmplWriter . flush ( ) ; } catch ( TemplateException te ) { throw new IOException ( "Template processing error " + te . getMessage ( ) ) ; } }
Writes the datum as a stream of bytes.
Writes the datum as a stream of bytes .