In this tutorial, we will see how to clear a float buffer in java.
The java.nio.FloatBuffer class extends java.nio.Buffer class. It provides the following methods:
|static FloatBuffer||allocate( int capacity)||The allocate() method allocate a new float buffer of given capacity.|
|abstract FloatBuffer||put(float f)||The put(..) method write a float value on the current position and increment position.|
|abstract float||get()||The get() method read float value from buffer current position and increment the position.|
|Buffer||flip()||The flip() method transfer the buffer from writing mode to reading mode.|
|Buffer||clear()||The clear() method clean a buffer, and after clear the position will be zero and limit will be capacity of buffer.|
Before clear method data in buffer.
After clear method data in buffer.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.