ByteArrayOutputStreamEx baos = null;
try {
baos = new ByteArrayOutputStreamEx();
is = dh.getDataSource().getInputStream();
baos.readFrom(is);
data = baos.toByteArray();
len = data.length;
baos.close();
is.close();
} catch (IOException ioe) {
logger.log(Level.SEVERE, "could not get the inputstream from the data handler", ioe);