@Override public BufferedImage JPEGToRGBImage(final byte[] data,final int ww,final int hh,final int pX,final int pY){
  BufferedImage image=null;
  Raster ras=JPEGDecoder.getRasterFromJPEG(data,"JPEG");
  if (ras != null) {
    ras=cleanupRaster(ras,pX,pY,componentCount);
    final int w=ras.getWidth();
    final int h=ras.getHeight();
    final DataBufferByte rgb=(DataBufferByte)ras.getDataBuffer();
    image=createImage(w,h,rgb.getData());
  }
  return image;
}

@ Override public BufferedImage JPEGToRGBImage ( final byte [ ] data , final int ww , final int hh , final int pX , final int pY ) { BufferedImage image = null ; Raster ras = JPEGDecoder . getRasterFromJPEG ( data , "JPEG" ) ; if ( ras != null ) { ras = cleanupRaster ( ras , pX , pY , componentCount ) ; final int w = ras . getWidth ( ) ; final int h = ras . getHeight ( ) ; final DataBufferByte rgb = ( DataBufferByte ) ras . getDataBuffer ( ) ; image = createImage ( w , h , rgb . getData ( ) ) ; } return image ; }
convert data stream to srgb image
