public final class Signed32 extends Object
| Modifier and Type | Method | Description |
|---|---|---|
static ByteBuffer |
packToBuffer(int i,
ByteBuffer r,
int index) |
|
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 byte[] |
packToBytesBigEndian(int i,
byte[] r) |
Pack
i into a byte buffer r using a big-endian
encoding such that the most significant byte is in r[0]. |
static byte[] |
packToBytesBigEndianAllocate(int i) |
Pack
i into a byte buffer b using a big-endian
encoding such that the most significant byte is in b[0]. |
static byte[] |
packToBytesLittleEndian(int i,
byte[] r) |
Pack
i into a byte buffer r using a
little-endian encoding such that the least significant byte is in
r[0]. |
static byte[] |
packToBytesLittleEndianAllocate(int i) |
Pack
i into a byte buffer b using a
little-endian encoding such that the least significant byte is in
b[0]. |
static int |
unpackFromBuffer(ByteBuffer buffer,
int index) |
|
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]
. |
static int |
unpackFromBytesBigEndian(byte[] buffer) |
Unpack an integer from
buffer assuming a big-endian encoding
such that the most significant byte is in b[0]. |
static int |
unpackFromBytesLittleEndian(byte[] buffer) |
Unpack an integer from
buffer assuming a little-endian
encoding such that the least significant byte is in b[0]. |
public static byte[] packToBytesBigEndianAllocate(int i)
Pack i into a byte buffer b using a big-endian
encoding such that the most significant byte is in b[0].
i - The value to be packed.public static byte[] packToBytesBigEndian(int i,
byte[] r)
Pack i into a byte buffer r using a big-endian
encoding such that the most significant byte is in r[0].
r - The bufferi - The value to be packed.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 byte[] packToBytesLittleEndianAllocate(int i)
Pack i into a byte buffer b using a
little-endian encoding such that the least significant byte is in
b[0].
i - The value to be packed.public static byte[] packToBytesLittleEndian(int i,
byte[] r)
Pack i into a byte buffer r using a
little-endian encoding such that the least significant byte is in
r[0].
r - The bufferi - The value to be packed.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 ByteBuffer packToBuffer(int i, ByteBuffer r, int index)
Pack i into a byte buffer r using the encoding
returned by ByteBuffer.order(), starting at index.
r - The buffer.i - The value to be packed.index - The starting index.rpublic static int unpackFromBytesBigEndian(byte[] buffer)
Unpack an integer from buffer assuming a big-endian encoding
such that the most significant byte is in b[0].
The function throws NullPointerException if
buffer == null and IllegalArgumentException if
buffer.length is too small to contain a packed integer value
of this size.
buffer - The buffer from which to unpack datapublic 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 buffer, int index)
Unpack an integer from buffer using the encoding returned by
ByteBuffer.order(), starting at index.
index - The starting indexbuffer - The buffer from which to unpack data.public static int unpackFromBytesLittleEndian(byte[] buffer)
Unpack an integer from buffer assuming a little-endian
encoding such that the least significant byte is in b[0].
The function throws NullPointerException if
buffer == null and IllegalArgumentException if
buffer.length is too small to contain a packed integer value
of this size.
buffer - The buffer from which to unpack datapublic 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 © 2017 <code@io7m.com> http://io7m.com