public final class Unsigned16 extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
packToBuffer(int x,
ByteBuffer data,
int index)
Pack an unsigned 16-bit integer into the buffer.
|
static ByteBuffer |
packToBufferBigEndian(int i,
ByteBuffer r,
int index)
Pack
i into a byte buffer r using a big-endian
encoding such that the most significant byte is in r[index]. |
static ByteBuffer |
packToBufferLittleEndian(int i,
ByteBuffer r,
int index)
Pack
i into a byte buffer r using a
little-endian encoding such that the least significant byte is in
r[index]. |
static int |
unpackFromBuffer(ByteBuffer data,
int index)
Unpack an unsigned 16-bit integer from the buffer.
|
static int |
unpackFromBufferBigEndian(ByteBuffer buffer,
int index)
Unpack an integer from
buffer assuming a big-endian encoding
such that the most significant byte is in b[index]. |
static int |
unpackFromBufferLittleEndian(ByteBuffer buffer,
int index)
Unpack an integer from
buffer assuming a little-endian
encoding such that the least significant byte is in b[index]
. |
public static ByteBuffer packToBufferBigEndian(int i, ByteBuffer r, int index)
Pack i into a byte buffer r using a big-endian
encoding such that the most significant byte is in r[index].
r - The buffer.i - The value to be packed.index - The starting index.rpublic static ByteBuffer packToBufferLittleEndian(int i, ByteBuffer r, int index)
Pack i into a byte buffer r using a
little-endian encoding such that the least significant byte is in
r[index].
r - The buffer.i - The value to be packed.index - The starting index.rpublic static void packToBuffer(int x,
ByteBuffer data,
int index)
x - The value.data - The buffer.index - The starting index.public static int unpackFromBufferBigEndian(ByteBuffer buffer, int index)
Unpack an integer from buffer assuming a big-endian encoding
such that the most significant byte is in b[index].
index - The starting index in the buffer.buffer - The buffer from which to unpack data.public static int unpackFromBuffer(ByteBuffer data, int index)
data - The buffer.index - The starting index.public static int unpackFromBufferLittleEndian(ByteBuffer buffer, int index)
Unpack an integer from buffer assuming a little-endian
encoding such that the least significant byte is in b[index]
.
index - The starting indexbuffer - The buffer from which to unpack data.Copyright © 2014 <code@io7m.com> http://io7m.com