I have a custom class vtools.Image that extends BufferedImage.
Then I am reading a picture from a url using ImageIO.read and sacing this as BufferedImage.
BufferedImage bfImg = ImageIO.read(imageUrl);
but then I would need to convert this bfImg into vtools.Image but when I try to cast it I am getting a ClassCastException error. What is the other way of converting these two?
EDIT: At first I thought, that you could simply write a special constructor, that takes a
BufferedImage. But that is not that easy. So I would recommend to write a wrapper class like this: