public class NumberFacility
extends java.lang.Object
| Constructor and Description |
|---|
NumberFacility() |
| Modifier and Type | Method and Description |
|---|---|
static boolean[] |
getBits(byte... bytes)
Gets bits as boolean array from a given byte array.
|
static boolean[] |
getBits(byte b)
Gets bits as boolean array from a given byte.
|
static byte[] |
getBytes(int value)
Gets byte array from integer.
|
static byte[] |
getBytes(int value,
int length)
Gets byte array from integer.
|
static int |
getInt(byte... bytes)
Gets integer value corresponding to the given bytes.
|
static int |
getReverseInt(byte... bytes)
Reverts bytes and retrieves the corresponding integer value.
|
static int |
getReverseInt(int value)
Gets byte array corresponding to the given integer value, reverses obtained byte array and retrieves the new
integer value.
|
static long |
getReverseUInt(byte... bytes)
Reverses bytes and retrieves the corresponding unsigned integer value.
|
static long |
getReverseUInt(int value)
Gets byte array corresponding to the given integer value, reverses obtained byte array and retrieves the new
unsigned integer value.
|
static long |
getUInt(byte... bytes)
Gets unsigned integer value corresponding to the given bytes.
|
static byte[] |
getUIntBytes(long value)
Gets byte array corresponding to a given unsigned integer.
|
static byte[] |
leftTrim(byte... bytes)
Remove 0x00 bytes from left side.
|
static byte[] |
rightTrim(byte... bytes)
Remove 0x00 bytes from right side.
|
public static byte[] getUIntBytes(long value)
value - unsigned integer.public static byte[] getBytes(int value)
value - integer.public static byte[] getBytes(int value,
int length)
value - integer.length - array size.public static byte[] leftTrim(byte... bytes)
bytes - source array.public static byte[] rightTrim(byte... bytes)
bytes - source array.public static boolean[] getBits(byte... bytes)
bytes - bytes.public static boolean[] getBits(byte b)
b - byte.public static int getReverseInt(byte... bytes)
bytes - bytes.public static long getReverseUInt(byte... bytes)
bytes - bytes.public static int getReverseInt(int value)
value - integer value.public static long getReverseUInt(int value)
value - integer value.public static int getInt(byte... bytes)
bytes - bytes.public static long getUInt(byte... bytes)
bytes - bytes.Copyright © 2015-2018 Tirasa. All Rights Reserved.