Class IoUtil
- java.lang.Object
-
- org.camunda.bpm.model.xml.impl.util.IoUtil
-
public final class IoUtil extends java.lang.Object
- Author:
- Daniel Meyer, Sebastian Menski
-
-
Constructor Summary
Constructors Constructor Description IoUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
closeSilently(java.io.Closeable closeable)
static java.io.InputStream
convertOutputStreamToInputStream(java.io.OutputStream outputStream)
Converts aOutputStream
to anInputStream
by coping the data directly.static java.lang.String
convertXmlDocumentToString(DomDocument document)
Converts aDomDocument
to its String representationstatic java.lang.String
getStringFromInputStream(java.io.InputStream inputStream)
Convert anInputStream
to aString
static void
transformDocumentToXml(DomDocument document, javax.xml.transform.stream.StreamResult result)
Transforms aDomDocument
to XML output.static void
writeDocumentToOutputStream(DomDocument document, java.io.OutputStream outputStream)
Writes aDomDocument
to anOutputStream
by transforming the DOM to XML.
-
-
-
Method Detail
-
closeSilently
public static void closeSilently(java.io.Closeable closeable)
-
getStringFromInputStream
public static java.lang.String getStringFromInputStream(java.io.InputStream inputStream) throws java.io.IOException
Convert anInputStream
to aString
- Parameters:
inputStream
- theInputStream
to convert- Returns:
- the resulting
String
- Throws:
java.io.IOException
-
convertOutputStreamToInputStream
public static java.io.InputStream convertOutputStreamToInputStream(java.io.OutputStream outputStream)
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
public static java.lang.String convertXmlDocumentToString(DomDocument document)
Converts aDomDocument
to its String representation- Parameters:
document
- the XML document to convert
-
writeDocumentToOutputStream
public static void writeDocumentToOutputStream(DomDocument document, java.io.OutputStream outputStream)
Writes aDomDocument
to anOutputStream
by transforming the DOM to XML.- Parameters:
document
- the DOM document to writeoutputStream
- theOutputStream
to write to
-
transformDocumentToXml
public static void transformDocumentToXml(DomDocument document, javax.xml.transform.stream.StreamResult result)
Transforms aDomDocument
to XML output.- Parameters:
document
- the DOM document to transformresult
- theStreamResult
to write to
-
-