I am having a DataHandler
problem.
I am trying to collect their contents in a file. This is created with the size of the buffer allocated damaged but without content, so I do not get to write anything on it.
This is the code i'm using:
Important, the "ciDoc" is a javax.activation.DataHandler
.
byte[] buffer = org.apache.commons.io.IOUtils.toByteArray(ciDoc.getInputStream());
org.apache.commons.io.FileUtils.writeByteArrayToFile(fileItemUCM.getFile(), buffer);
item.setFile(fileItemUCM.getFile());
The fileItemUCM.getFile()
is always damaged, really is nothing writing into it.