FloatBuffer has the method capacity() which tells us the maximum capacity of the FloatBuffer. However, it does not tell us how many elements are in that buffer. So how can I determine the number of elements in a FloatBuffer? I am trying to determine if my FloatBuffer is full or partially full.
FloatBuffer has the method capacity() which tells us the maximum capacity of the FloatBuffer
Share
I can never keep the NIO buffer’s straight in my head, but
remaining()might be what you’re after…(Or just use
hasRemaining()if you’re after a simple Boolean…)