public class DocumentUtils extends Object
| Constructor and Description |
|---|
DocumentUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Document |
byteToDocument(byte[] document) |
static Document |
byteToDocument(Byte[] document) |
Element |
byteToElement(byte[] document) |
static void |
elementToByte(Element element,
OutputStream out) |
static byte[] |
getBytesFromDocument(Document document) |
static void |
getDocumentToOutputStream(Document doc,
ByteArrayOutputStream signatureFile) |
static String |
getDocumentToString(Document document) |
static Document |
getEmptyDocument() |
static Document |
getInputStreamToDocument(InputStream inputStream)
Convert an inputStream to a Document Object
|
static byte[] |
getStreamToBytes(InputStream stream) |
static Document |
getStringToDocument(String xml)
Convert a string to a Document Object
|
static ByteArrayOutputStream |
getStringToStream(String document) |
public static Document byteToDocument(byte[] document) throws Exception
Exceptionpublic static Document byteToDocument(Byte[] document) throws Exception
Exceptionpublic static void elementToByte(Element element, OutputStream out) throws TransformerException
TransformerExceptionpublic static ByteArrayOutputStream getStringToStream(String document) throws IOException
IOExceptionpublic static byte[] getStreamToBytes(InputStream stream) throws Exception
Exceptionpublic static Document getStringToDocument(String xml) throws IOException, SAXException, ParserConfigurationException
xml - The xml to convertIOExceptionSAXExceptionParserConfigurationExceptionpublic static Document getInputStreamToDocument(InputStream inputStream) throws IOException, SAXException, ParserConfigurationException
inputStream - The inputstream to convertIOExceptionSAXExceptionParserConfigurationExceptionpublic static byte[] getBytesFromDocument(Document document) throws TransformerException
TransformerExceptionpublic static void getDocumentToOutputStream(Document doc, ByteArrayOutputStream signatureFile) throws TransformerException
TransformerExceptionpublic static Document getEmptyDocument() throws ParserConfigurationException
ParserConfigurationExceptionpublic static String getDocumentToString(Document document) throws TransformerException
TransformerExceptionpublic Element byteToElement(byte[] document) throws TransformerFactoryConfigurationError, Exception
Copyright © 2018. All rights reserved.