In this tutorial, we will see the use of slice method of FloatBuffer class 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 float buffer of given capacity.|
|abstract FloatBuffer||slice()||The slice() returns slice buffer that share the content of associated float buffer, and after the slicing position will be zero.|
Information of float buffer.
Position : 2
Capacity : 512
Limit : 512
Information of slice float buffer.
Position : 0
Capacity : 2
Limit : 2
value in slice float 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.