and how would you get a BufferedImage from that?
yeah common problem. I'm not an expert at this and have to fiddle around myself to get stuff like that to work.
my first guess would be to use the BufferedImage.setData method
which requires a Raster, so you use a WriteableRaster
it has a lot of methods like setPixel and setPixels
so from the ByteBuffer, PNGDecoder creates you have to make a Rastern, then apply it.
How exactly and if it is fast - not sure.
but when working with java2D I have just use ImageIO.read which does PNGs aswell of course