public BufferedImage getImage ( ) { ByteBuffer artwork = getRawBytes ( ) ; artwork . rewind ( ) ; byte [ ] imageBytes = new byte [ artwork . remaining ( ) ] ; artwork . get ( imageBytes ) ; try { return ImageIO . read ( new ByteArrayInputStream ( imageBytes ) ) ; } catch ( IOException e ) { logger . error ( "Weird! Caught exception creating image from artwork bytes" , e ) ; return null ; } }
Given the byte buffer containing album art build an actual image from it for easy rendering .