In this tutorial, you will see how to create a short buffer by using wrap method of ShortBuffer class.
In this tutorial, you will see how to create a short buffer by using wrap method of ShortBuffer class.In this tutorial, we will see how to create a shortt buffer by using wrap method of ShorttBuffer class.
The java.nio.ShortBuffer class extends java.nio.Buffer class. It provides the following methods:
Return type | Method | Description |
static ShortBuffer | wrap(short[] array) | The wrap() method create a short buffer by wrapping the associated short array. |
abstract short | get() | The get() method read short value from current position and increment position.. |
import java.nio.*;
|
C:\>java WrapShortBuffer Limit of short buffer : 3 capacity of short buffer : 3 Content in shortbuffer. 12 34 56 |