Class IoUtil
java.lang.Object
org.camunda.bpm.model.xml.impl.util.IoUtil
- Author:
- Daniel Meyer, Sebastian Menski
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
closeSilently
(Closeable closeable) static InputStream
convertOutputStreamToInputStream
(OutputStream outputStream) Converts aOutputStream
to anInputStream
by coping the data directly.static String
convertXmlDocumentToString
(DomDocument document) Converts aDomDocument
to its String representationstatic String
getStringFromInputStream
(InputStream inputStream) Convert anInputStream
to aString
static void
transformDocumentToXml
(DomDocument document, StreamResult result) Transforms aDomDocument
to XML output.static void
writeDocumentToOutputStream
(DomDocument document, OutputStream outputStream) Writes aDomDocument
to anOutputStream
by transforming the DOM to XML.
-
Constructor Details
-
IoUtil
public IoUtil()
-
-
Method Details
-
closeSilently
-
getStringFromInputStream
Convert anInputStream
to aString
- Parameters:
inputStream
- theInputStream
to convert- Returns:
- the resulting
String
- Throws:
IOException
-
convertOutputStreamToInputStream
Converts aOutputStream
to anInputStream
by coping the data directly. WARNING: Do not use for large data (>100MB). Only for testing purpose.- Parameters:
outputStream
- theOutputStream
to convert- Returns:
- the resulting
InputStream
-
convertXmlDocumentToString
Converts aDomDocument
to its String representation- Parameters:
document
- the XML document to convert
-
writeDocumentToOutputStream
Writes aDomDocument
to anOutputStream
by transforming the DOM to XML.- Parameters:
document
- the DOM document to writeoutputStream
- theOutputStream
to write to
-
transformDocumentToXml
Transforms aDomDocument
to XML output.- Parameters:
document
- the DOM document to transformresult
- theStreamResult
to write to
-