ByteStreams.copy(imageInputStream, imageDataOutputStream);
} catch (IOException ioe1) {
logger.log(Level.WARNING, "Could not read uploaded image!", ioe1);
return;
} finally {
fileBucket.free();
Closer.close(imageInputStream);
Closer.close(imageDataOutputStream);
}
byte[] imageData = imageDataOutputStream.toByteArray();
ByteArrayInputStream imageDataInputStream = null;