Hi,
I have to export lots of objects from a database into a XML file. These objects
contain large BLOBs,
so I started to implement a "BlobConverter". As the BLOBs are very large, I
cannot use the following
approach:
public void marshal(Object source, HierarchicalStreamWriter writer,
MarshallingContext context) {
Blob blob = (Blob) source;
context.convertAnother(blob.getBytes(1, (int) blob.length()));
This would read the whole BLOB into a byte array and delegate to
EncodedByteArrayConverter, which in
turn would write a base64 encoded string. This creates two arrays in the heap
(the byte array and
the char array with the base64 encoded data), which are way too large to fit
into the available heap
space.
So I am looking for a solution which would allow to stream the binary data into
a streaming base64
encoder and to stream that into the output stream. However, I could not find
any method in
HierarchicalStreamWriter which would allow to stream character data. There is
just "void
setValue(String text)", which requires the whole data to be in the heap.
Is it possible to stream character data to the output stream?
Regards,
Martin
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email