Problem creating an Image


I try to create an Image out of a ByteBuffer. I can’t use the TextureManager direct because the Texture Format is “.ACE” (Microsoft Train Simulator Texture).
I managed to read out the Infos in a ByteBuffer and I tested it directly in OpenGL. It works there so i assume that the ByteBuffer is set up correctly.
But now I like to do the same thing in JME. The first attempt ended in a white Texture and the following to. So I decided to try with a very simple ByteBuffer. Here is the code:

ACETexture ace = new ACETexture();
				ACELoader.loadACE(ace, file);
				ByteBuffer buf = BufferUtils.createByteBuffer(ace.width*ace.height*3);

				for(int j=0; j<ace.width*ace.height; j++)
					buf.put((byte) 255);
					buf.put((byte) 0);
					buf.put((byte) 0);
				Image img;
				img = new Image(Format.RGB16, ace.width, ace.height, buf);
				Texture tex = new Texture2D();

But when I do it like this, the result is a white plane to. Can anyone tell me, what I’m doing wrong?


rewind your buffer

yeah, I realised too after the post but the result is the same (white texture).