@Override public final BufferedImage dataToRGB(byte[] data,final int width,final int height){
  BufferedImage image;
  data=dataToRGBByteArray(data,width,height);
  final DataBuffer db=new DataBufferByte(data,data.length);
  final int[] bands={0,1,2};
  image=new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
  final Raster raster=Raster.createInterleavedRaster(db,width,height,width * 3,3,bands,null);
  image.setData(raster);
  return image;
}

@ Override public final BufferedImage dataToRGB ( byte [ ] data , final int width , final int height ) { BufferedImage image ; data = dataToRGBByteArray ( data , width , height ) ; final DataBuffer db = new DataBufferByte ( data , data . length ) ; final int [ ] bands = { 0 , 1 , 2 } ; image = new BufferedImage ( width , height , BufferedImage . TYPE_INT_RGB ) ; final Raster raster = Raster . createInterleavedRaster ( db , width , height , width * 3 , 3 , bands , null ) ; image . setData ( raster ) ; return image ; }
convert to rgb and return as an image
