Class ByteUtil
- java.lang.Object
-
- com.github.f4b6a3.uuid.util.internal.ByteUtil
-
public final class ByteUtil extends Object
Class that contains many static methods for byte handling.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringtoHexadecimal(byte[] bytes)Get a hexadecimal string from given array of bytes.static longtoNumber(byte[] bytes)Get a number from a given array of bytes.static longtoNumber(byte[] bytes, int start, int end)Get a number from a given array of bytes.
-
-
-
Method Detail
-
toNumber
public static long toNumber(byte[] bytes)
Get a number from a given array of bytes.- Parameters:
bytes- a byte array- Returns:
- a long
-
toNumber
public static long toNumber(byte[] bytes, int start, int end)Get a number from a given array of bytes.- Parameters:
bytes- a byte arraystart- first byte of the arrayend- last byte of the array (exclusive)- Returns:
- a long
-
toHexadecimal
public static String toHexadecimal(byte[] bytes)
Get a hexadecimal string from given array of bytes.- Parameters:
bytes- byte array- Returns:
- a string
-
-