* Method c14nAndCompare
*/
private void c14nAndCompare(
URL fileIn, URL fileRef, boolean ommitComments) throws Exception {
CanonicalizerBase canonicalizerBase;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
if (ommitComments) {
canonicalizerBase = new Canonicalizer20010315_OmitCommentsTransformer();
canonicalizerBase.setOutputStream(baos);
} else {
canonicalizerBase = new Canonicalizer20010315_WithCommentsTransformer();
canonicalizerBase.setOutputStream(baos);
}
XMLEventReader xmlSecEventReader = xmlInputFactory.createXMLEventReader(fileIn.openStream());
while (xmlSecEventReader.hasNext()) {
XMLSecEvent xmlSecEvent = (XMLSecEvent) xmlSecEventReader.nextEvent();
canonicalizerBase.transform(xmlSecEvent);
}
// org.xml.sax.InputSource refIs = resolver.resolveEntity(null, fileRef);
// byte refBytes[] = JavaUtils.getBytesFromStream(refIs.getByteStream());
byte refBytes[] = getBytesFromResource(fileRef);