Search in sources :

Example 6 with OverflowBlob

use of org.apache.axiom.util.blob.OverflowBlob in project wso2-synapse by wso2.

the class TextFileDataSourceTest method createSourcedElement.

private OMSourcedElement createSourcedElement(String content, Charset charset) throws IOException {
    OverflowBlob tmp = new OverflowBlob(4, 1024, "tmp_", ".dat");
    OutputStream out = tmp.getOutputStream();
    out.write(content.getBytes(charset.name()));
    out.close();
    return TextFileDataSource.createOMSourcedElement(tmp, charset);
}
Also used : OverflowBlob(org.apache.axiom.util.blob.OverflowBlob) OutputStream(java.io.OutputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream)

Aggregations

OverflowBlob (org.apache.axiom.util.blob.OverflowBlob)6 OutputStream (java.io.OutputStream)5 IOException (java.io.IOException)2 OMOutputFormat (org.apache.axiom.om.OMOutputFormat)2 MessageFormatter (org.apache.axis2.transport.MessageFormatter)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 ContentOutputStream (org.apache.http.nio.entity.ContentOutputStream)1 InboundEndpoint (org.apache.synapse.inbound.InboundEndpoint)1