Fast loading and drawing of RGB data in BufferedImage
问题 In some Java code running on Windows, I'm reading some large blocks of RGB data from disk and want to display this to screen as quickly as possible. The RGB data is 8 bits per channel without any alpha. Currently I have code like the following to create the BufferedImage. BufferedImage getBufferedImage(File file, int width, int height) { byte[] rgbData = readRGBFromFile(file); WritableRaster raster = Raster.createInterleavedRaster( rgbData, width, height, width * 3, // scanlineStride 3, //