In this tutorial, you will see how to transfer content from short buffer to short array.
In this tutorial, you will see how to transfer content from short buffer to short array.In this tutorial, we will see how to write the given short value into short buffer at the given index.
ShortBuffer API:
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 ShortBuffer | put(int index, short value) | The put(..) method write the given short value into associated buffer at given index. |
abstract short | get( ) | The get(...) method returns short value from current position . |
import java.nio.*;
|
C:\>java PutValueAtIndex Content in short buffer. 1 2 3 4 5 Put value at index . 2 Content in short buffer. 1 2 655 4 5 |