@Override public BufferedImage dataToRGB(byte[] data,final int width,final int height){
  BufferedImage image;
  try {
    data=dataToRGBByteArray(data,width,height);
    image=new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
    final Raster raster=ColorSpaceConvertor.createInterleavedRaster(data,width,height);
    image.setData(raster);
  }
 catch (  final Exception ee) {
    image=null;
    LogWriter.writeLog("Couldn't read JPEG, not even raster: " + ee);
  }
  return image;
}

@ Override public BufferedImage dataToRGB ( byte [ ] data , final int width , final int height ) { BufferedImage image ; try { data = dataToRGBByteArray ( data , width , height ) ; image = new BufferedImage ( width , height , BufferedImage . TYPE_INT_RGB ) ; final Raster raster = ColorSpaceConvertor . createInterleavedRaster ( data , width , height ) ; image . setData ( raster ) ; } catch ( final Exception ee ) { image = null ; LogWriter . writeLog ( "Couldn't read JPEG, not even raster: " + ee ) ; } return image ; }
convert lab stream to rgb and return as an image
