In this tutorial, you will see how to create a long buffer by wrapping an long array.
In this tutorial, you will see how to create a long buffer by wrapping an long array.In this tutorial, we will see how to create a long buffer by wrapping an long array into a buffer.
LongBuffer API:
The java.nio.LongBuffer class extends java.nio.Buffer class. It provides the following methods:
Return type | Method | Description |
static LongBuffer | wrap(long[] array) | The wrap(....) method wrap an existing long array and create long buffer. |
Buffer API:
The java.nio.Buffer class extends java.lang.Object class. It provides the following methods:
Return type | Method | Description |
int | limit() | The limit() method returns the limit of int buffer. |
int | position() | The position() method returns the position of int buffer. |
final int | capacity() | The capacity() method returns the capacity of associated int buffer. |
import java.nio.*;
|
C:\>java WrapLongBuffer Content in long buffer. 6545555 7878677 Capacity of LongBuffer : 2 Limit of LongBuffer : 2 Position of LongBuffer : 2 |