In this tutorial, we will see how to represent the state of buffer in the form of string.
FloatBuffer API:
The java.nio.FloatBuffer class extends java.nio.Buffer class. It provides the following methods:
| Return type | Method | Description |
| static FloatBuffer | allocate( int capacity) | The allocate(..) method allocate a float buffer of given capacity. |
| abstract FloatBuffer | toString | The toString() method returns a string that summarizing of buffer state. |
import java.nio.*;
|
| C:\>java FlBufferToString Information of float buffer. Position : 2 Limit : 512 Capacity : 512 String representation of the float buffer state. java.nio.HeapFloatBuffer[pos=2 lim=512 cap=512] |
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.