public static enum BinaryVectors.Endianness extends Enum<BinaryVectors.Endianness>
Enum Constant and Description |
---|
BIG_ENDIAN
Decreasing numeric significance with increasing addresses/indices.
|
LITTLE_ENDIAN
Increasing numeric significance with increasing addresses/indices.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
appendLongAsBinaryString(StringBuilder b,
long l)
Convert 64 bit long to binary string.
|
abstract int |
packBytesToInt(byte[] buffer,
int firstIndex)
Pack four 8 bit bytes into a 32 bit int.
|
int |
packBytesToInt(byte b0,
byte b1,
byte b2,
byte b3)
Pack four 8 bit bytes into a 32 bit int.
|
abstract long |
packBytesToLong(byte[] buffer,
int firstIndex)
Pack eight 8 bit bytes into a 64 bit long.
|
long |
packBytesToLong(byte b0,
byte b1,
byte b2,
byte b3,
byte b4,
byte b5,
byte b6,
byte b7)
Pack eight 8 bit bytes into a 64 bit long.
|
abstract int |
packIntIntoBitSet(int i,
BitSet b,
int start)
Pack an int value into a BitSet.
|
abstract long |
packIntsToLong(int i0,
int i1)
Pack two 32 bit integers into a 64 bit long.
|
abstract int |
packLongIntoBitSet(long l,
BitSet b,
int start)
Pack a long value into a BitSet.
|
abstract long |
parseBinaryStringAsLong(String s)
Parse a binary String as a 64 bit long.
|
byte[] |
unpackBytesFromInt(int i)
Unpack four 8 bit bytes from a 32 bit int.
|
abstract void |
unpackBytesFromInt(int i,
byte[] buffer,
int firstIndex)
Unpack four 8 bit bytes from a 32 bit int.
|
byte[] |
unpackBytesFromLong(long l)
Unpack eight 8 bit bytes from a 64 bit long.
|
abstract void |
unpackBytesFromLong(long l,
byte[] buffer,
int firstIndex)
Unpack eight 8 bit bytes from a 64 bit long.
|
abstract int |
unpackInt0FromLong(long l)
Unpack first 32 bit integer from a 64 bit long according to the represented endianness.
|
abstract int |
unpackInt1FromLong(long l)
Unpack second 32 bit integer from a 64 bit long according to the represented endianness.
|
abstract int |
unpackIntFromBitSet(BitSet b,
int start)
Unpack an int value from a BitSet.
|
abstract long |
unpackLongFromBitSet(BitSet b,
int start)
Unpack a long value from a BitSet.
|
static BinaryVectors.Endianness |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BinaryVectors.Endianness[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final BinaryVectors.Endianness BIG_ENDIAN
Most significant part first.
public static final BinaryVectors.Endianness LITTLE_ENDIAN
Least significant part first.
public static BinaryVectors.Endianness[] values()
for (BinaryVectors.Endianness c : BinaryVectors.Endianness.values()) System.out.println(c);
public static BinaryVectors.Endianness valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic abstract long packIntsToLong(int i0, int i1)
i0
- First integer, associated with lower index/addressi1
- Second integer, associated with higher index/addresspublic abstract int unpackInt0FromLong(long l)
l
- Packed longpublic abstract int unpackInt1FromLong(long l)
l
- Packed longpublic long packBytesToLong(byte b0, byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7)
b0
- First byte, associated with lowest index/addressb1
- Second byteb2
- Third byteb3
- Fourth byteb4
- Fifth byteb5
- Sixth byteb6
- Seventh byteb7
- Eighth byte, associated with the highest index/addresspublic int packBytesToInt(byte b0, byte b1, byte b2, byte b3)
b0
- First byte, associated with lowest index/addressb1
- Second byteb2
- Third byteb3
- Fourth byte, associated with the highest index/addresspublic abstract long packBytesToLong(byte[] buffer, int firstIndex)
buffer
- Buffer containing bytes to packfirstIndex
- Index of the first byte to pack in the bufferpublic abstract int packBytesToInt(byte[] buffer, int firstIndex)
buffer
- Buffer containing bytes to packfirstIndex
- Index of the first byte to pack in the bufferpublic byte[] unpackBytesFromLong(long l)
l
- Packed longpublic byte[] unpackBytesFromInt(int i)
i
- Packed intpublic abstract void unpackBytesFromLong(long l, byte[] buffer, int firstIndex)
l
- Packed longbuffer
- target bufferfirstIndex
- Index of the first byte to write in the buffer (associated with the lowest index/address)public abstract void unpackBytesFromInt(int i, byte[] buffer, int firstIndex)
i
- Packed intbuffer
- target bufferfirstIndex
- Index of the first byte to write in the buffer (associated with the lowest index/address)public abstract long parseBinaryStringAsLong(String s)
s
- Binary String to parseIllegalArgumentException
- when parameter String length differs from 64 or contains other than '0' and
'1' characterspublic abstract void appendLongAsBinaryString(StringBuilder b, long l)
b
- Target buffer to write tol
- Long to convertpublic abstract int unpackIntFromBitSet(BitSet b, int start)
b
- Source BitSet.start
- Position of first bit to read in the BitSetpublic abstract long unpackLongFromBitSet(BitSet b, int start)
b
- Source BitSet.start
- Position of first bit to read in the BitSetpublic abstract int packIntIntoBitSet(int i, BitSet b, int start)
i
- Value to packb
- Target BitSetstart
- Position of the first bit to writepublic abstract int packLongIntoBitSet(long l, BitSet b, int start)
l
- Value to packb
- Target BitSetstart
- Position of the first bit to write