RGBByteBuffer j2DBuf = new RGBByteBuffer(buf, sizeX, sizeY); BandedSampleModel csm = new BandedSampleModel(DataBuffer.TYPE_BYTE, sizeX, sizeY, 3);
DataBuffer j2DBuf = new DataBufferInt(buf, sizeX * sizeY, 0);    SinglePixelPackedSampleModel sampleModel = new SinglePixelPackedSampleModel( DataBuffer.TYPE_INT, sizeX, sizeY, sizeX, new int[] { 0x00ff0000, 0x0000ff00, 0x000000ff,  });    WritableRaster raster = new IntegerInterleavedRaster(sampleModel, j2DBuf, new Point(0, 0));    ColorModel colorModel = new DirectColorModel(24, 0x00ff0000, 0x0000ff00, 0x000000ff  );
	private BufferedImage createBufferedImage(RGBBuffer buf,	                                          int sizeX, int sizeY)	{		RGBByteBuffer j2DBuf = new RGBByteBuffer(buf, sizeX, sizeY);		BandedSampleModel csm =			new BandedSampleModel(DataBuffer.TYPE_BYTE, sizeX, sizeY, 3);		BufferedImage image =			new BufferedImage(sizeX, sizeY, BufferedImage.TYPE_INT_RGB);		image.setData(Raster.createWritableRaster(csm, j2DBuf, null));		return image;				/*		Unfortunately, the following creates "CUSTOM" buffered images which		with some VM's cannot be used in the ImagingLib. Nasty.				ColorModel cm = new ComponentColorModel(				ColorSpace.getInstance(ColorSpace.CS_sRGB), 				null, false, false, Transparency.OPAQUE, 				DataBuffer.TYPE_BYTE);		WritableRaster r = Raster.createWritableRaster(csm, j2DBuf, null);		return new BufferedImage(cm, r, false, null);		*/	}