diff options
Diffstat (limited to 'id/server/moa-id-commons')
-rw-r--r-- | id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java index 95cd63643..fed968443 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java @@ -49,6 +49,7 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; +import org.apache.commons.io.IOUtils; import org.apache.xerces.parsers.DOMParser; import org.apache.xerces.parsers.SAXParser; import org.apache.xerces.parsers.XMLGrammarPreparser; @@ -225,12 +226,13 @@ public class DOMUtils { byte buffer [] = null; ByteArrayInputStream baStream = null; if(true == Logger.isDebugEnabled()) { - int len = inputStream.available(); - buffer = new byte[len]; - inputStream.read(buffer); + buffer = IOUtils.toByteArray(inputStream); baStream = new ByteArrayInputStream(buffer); - } + } + + + // create the DOM parser if (symbolTable != null) { parser = new DOMParser(symbolTable, grammarPool); @@ -298,7 +300,7 @@ public class DOMUtils { else parser.parse(new InputSource(inputStream)); } catch(SAXException e) { - if(true == Logger.isDebugEnabled() && null != buffer) { + if(true == Logger.isDebugEnabled() && null != buffer) { String xmlContent = new String(buffer); Logger.debug("SAXException in:\n" + xmlContent); } |