In this tutorial, you will see how to define the order of byte in short buffer.
In this tutorial, you will see how to define the order of byte in short buffer.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 wrapping an existing short array into short buffer. |
abstract ByteOrder | order() | The order(..) method returns order of bytes used by short buffer. |
ByteBuffer API:
The java.nio.ByteBuffer class extends java.nio.Buffer class. It provides the following methods:
Return type | Method | Description |
static ByteBuffer | wrap([] array) | The wrap(....) method wrapping an existing byte array into byte buffer. |
abstrtact ShortBuffer | asShortBuffer() | The asShortBuffer() method returns short buffer based on byte buffer. |
import java.nio.*;
|
C:\>java ByteOrder Byte order of short buffer : BIG_ENDIAN Byte order of short buffer : LITTLE_ENDIAN |