public Object decode(InputStream input, String mimeType, boolean asynchronous) throws Exception {
if (asynchronous) {
File file = resourceManager.getTemporaryFile(".bin");
FileUtils.copyInputStreamToFile(input, file);
return new FileRawData(file, mimeType);
} else {
return new StreamRawData(mimeType, input);
}
}