documentToBytes
Converts a document to an array of bytes.
Input Parameters
document | Document Document to convert to bytes. If document is null, the service does not return an output or an error message. If document is not a document, the service throws a service exception. If document contains no elements, the service produces a zero-length byte array. |
Output Parameters
documentBytes | Object A serialized representation of the document as an array of bytes (byte[]). |
Usage Notes
Use the documentToBytes service with the bytesToDocument service, which converts the byte array created by this service back into the original document.
The documentToBytes service is useful when you want to write a document to a file, an input stream, or a cache.
In order for the document-to-bytes-to-document conversion to work, the entire content of the document must be serializable. Every object in the document must be of a data type known to Integration Cloud, or it must support the java.io.Serializable interface. If Integration Cloud encounters an unknown object in the document that does not support the java.io.Serializable interface, that object's value will be lost. Integration Cloud will replace it with a string containing the object's class name.