public final class Signed64 extends Object
| Modifier and Type | Method | Description |
|---|---|---|
static ByteBuffer |
packToBuffer(long i,
ByteBuffer r,
int index) |
|
static ByteBuffer |
packToBufferBigEndian(long 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(long 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(long 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(long 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(long 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(long i) |
Pack
i into a byte buffer b using a
little-endian encoding such that the least significant byte is in
b[0]. |
static long |
unpackFromBuffer(ByteBuffer buffer,
int index) |
|
static long |
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 long |
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 long |
unpackFromBytesBigEndian(byte[] buffer) |
Unpack an integer from
buffer assuming a big-endian encoding
such that the most significant byte is in b[0]. |
static long |
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(long 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(long 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.rpublic static ByteBuffer packToBufferBigEndian(long 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(long 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(long 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(long 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(long 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 long 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 long 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 long 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 long 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 long 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