Hi Jesper,
Thanks for your reply adn apology if I was not clear in my question.
I have a FileOutputStream object adn I want to convert it to a BufferedImage as the new encode() takes BufferedImage instead of FileOutputStream (that was used earlier).
FileOutputStream fos = null;
fos = new FileOutputStream(actualImagePath,false);
if (fos != null) {customBean.encode(<BufferredImageRequired>

;
I cannot change the approach to maintain backward compatibility.
Is there a way we can do this?