Sunday 19 May 2013

java.lang.IllegalArgumentException: buf is empty. Forgot to call flip()?


It has two chances possible for this error:
1. Forget to call flip() after put/write into Buffer.
2. If you used wrap() , then no need to call flip().Because wrap() will set position to Zero. it is ready for read from Buffer.



Here are the better articles I suggest:

ByteBuffer
ByteBuffer Tutorial

Please post me here I will help you on this.

No comments:

Post a Comment

Please comment here