Refreshing a texture after in-game modification

You need to make sure the buffer is in a state for reading… and you probably want to get in the practice of grabbing a read-only view of it:
http://docs.oracle.com/javase/7/docs/api/java/nio/ByteBuffer.html#asReadOnlyBuffer()

But at least you will want to rewind the buffer before saving else it may already be at the end.

2 Likes