use of org.openexi.sax.Transmogrifier in project ddf by codice.
the class EXIEncoder method encode.
/**
* Takes the incoming xmlStream and performs EXI-encoding on it into the exiStream.
*
* @param xmlStream Input of xml data
* @param exiStream Output of exi-encoded data
* @throws EXIOptionsException
* @throws TransmogrifierException
* @throws java.io.IOException
*/
public static void encode(InputStream xmlStream, OutputStream exiStream) throws EXIOptionsException, TransmogrifierException, IOException {
Transmogrifier trans = new Transmogrifier();
trans.setAlignmentType(AlignmentType.bitPacked);
GrammarCache grammarCache = new GrammarCache(null, GrammarOptions.DEFAULT_OPTIONS);
trans.setGrammarCache(grammarCache);
trans.setOutputStream(exiStream);
LOGGER.debug("Starting EXI encoding process.");
trans.encode(new InputSource(xmlStream));
LOGGER.debug("EXI encoding complete.");
}
Aggregations