In this tutorial you will see how to allocate a float buffer in java.
In this tutorial you will see how to allocate a float buffer in java.In this tutorial, we will see how to allocate a new float buffer.
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. |
int | limit() | The limit() method returns the limit of float buffer. |
int | position() | The position() method returns the position of float buffer. |
final int | capacity() | The capacity() method returns the capacity of associated float buffer. |
import java.nio.*;
|
C:\>java FloatBufferDemo Position of FloatBuffer :0 Limit of FloatBuffer :500 Capacity of FloatBuffer :500 |