Not sure if it's the right place to post, but to follow
Bug Hunting on Android … posted by Sven, there will be potentially more nio bugs in Android ICS (4.0.1).
After long debugging, I've found that ShortBuffer.put(short) and put(int,short) for ShortBuffer created with ByteBuffer.asShortBuffer is not properly implemented. This is also the case for similar method in FloatBuffer, IntBuffer, ...
Giving a quick look in
android ics source of 14 Nov, this bug seem confirmed. The ShortBuffer implementation is ShortToByteBufferAdapter, put(short) and put(int,short) does not properly keep in sync the limit to the internal byteBuffer, while put(short[]) does.
Expect strange behavior if you're using put(short) after using modifying limit and with put(short[]) operations.
Here's a
test case showing the bug.
Not sure if this bug will be in official ICS, but some devices will possibly have it. I'm using a google nexus s phone with cyanogen mod cm9 rom.
Does anyone have an official ICS device to comfirm this bug ?
Edit: If someone know where bug should be filled to google, please let me know :)
Jérôme