public static void main(String args[]) {
System.setProperty("streamer.Element.debug", "true");
BufferedImageCanvas canvas = new BufferedImageCanvas(4, 4);
Element renderer = new BufferedImagePixelsAdapter("renderer", canvas);
byte[] pixels = new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
int[] pixelsLE = new int[] {0x04030201, 0x08070605, 0x0c0b0a09, 0x100f0e0d, 0x04030201, 0x08070605, 0x0c0b0a09, 0x100f0e0d, 0x04030201, 0x08070605,
0x0c0b0a09, 0x100f0e0d, 0x04030201, 0x08070605, 0x0c0b0a09, 0x100f0e0d};
ByteBuffer buf = new ByteBuffer(pixels);
buf.putMetadata(TARGET_X, 0);
buf.putMetadata(TARGET_Y, 0);
buf.putMetadata(WIDTH, 4);
buf.putMetadata(HEIGHT, 4);
buf.putMetadata(PIXEL_FORMAT, RGB888LE32);
renderer.handleData(buf, null);
String actualData = Arrays.toString(((DataBufferInt)canvas.getOfflineImage().getRaster().getDataBuffer()).getData());
String expectedData = Arrays.toString(pixelsLE);
if (!actualData.equals(expectedData))
System.err.println("Actual image: " + actualData + "\nExpected image: " + expectedData + ".");