Package io.aether.utils
Class HexUtils
- java.lang.Object
-
- io.aether.utils.HexUtils
-
public class HexUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description HexUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]hexToBytes(java.lang.CharSequence s)Converts a hexadecimal string to a byte array.static java.lang.StringtoHexString(byte[] bytes)Converts a byte array to a hexadecimal string.static java.lang.StringtoHexString(byte[] bytes, int offset, int endIndex)Converts a byte array to a hexadecimal string with a specified offset and end index.static voidtoHexString(byte[] bytes, int offset, int endIndex, char[] hexChars, int destOffset)Converts a byte array to a hexadecimal string with a specified offset and end index.static voidtoHexString(byte[] bytes, int offset, int endIndex, AString hexChars)Converts a byte array to a hexadecimal string with a specified offset and end index.static voidtoHexString(int bytes, char[] hexChars, int destOffset)Converts an integer to a hexadecimal string with a specified destination array and offset.static voidtoHexString(int src, AString hexChars)Converts an integer to a hexadecimal string.static voidtoHexString(long bytes, char[] hexChars, int destOffset)Converts a long integer to a hexadecimal string with a specified destination array and offset.static voidtoHexString(long src, AString hexChars)Converts a long integer to a hexadecimal string.static char[]toHexString2(byte[] bytes)static char[]toHexString2(byte[] bytes, int offset, int endIndex)Converts a byte array to a hexadecimal string with a specified offset and end index.
-
-
-
Method Detail
-
hexToBytes
public static byte[] hexToBytes(java.lang.CharSequence s)
Converts a hexadecimal string to a byte array.- Parameters:
s- The hexadecimal string- Returns:
- A byte array representation of the hexadecimal string
-
toHexString
public static java.lang.String toHexString(byte[] bytes)
Converts a byte array to a hexadecimal string.- Parameters:
bytes- The byte array- Returns:
- A hexadecimal string representation of the byte array
-
toHexString2
public static char[] toHexString2(byte[] bytes)
-
toHexString
public static java.lang.String toHexString(byte[] bytes, int offset, int endIndex)Converts a byte array to a hexadecimal string with a specified offset and end index.- Parameters:
bytes- The byte arrayoffset- The starting indexendIndex- The ending index (exclusive)- Returns:
- A hexadecimal string representation of the specified portion of the byte array
-
toHexString2
public static char[] toHexString2(byte[] bytes, int offset, int endIndex)Converts a byte array to a hexadecimal string with a specified offset and end index.- Parameters:
bytes- The byte arrayoffset- The starting indexendIndex- The ending index (exclusive)- Returns:
- A hexadecimal string representation of the specified portion of the byte array
-
toHexString
public static void toHexString(byte[] bytes, int offset, int endIndex, char[] hexChars, int destOffset)Converts a byte array to a hexadecimal string with a specified offset and end index.- Parameters:
bytes- The byte arrayoffset- The starting indexendIndex- The ending index (exclusive)hexChars- The character array to store the resultdestOffset- The starting position in the destination array
-
toHexString
public static void toHexString(int src, AString hexChars)Converts an integer to a hexadecimal string.- Parameters:
src- The integerhexChars- The character array to store the result
-
toHexString
public static void toHexString(long src, AString hexChars)Converts a long integer to a hexadecimal string.- Parameters:
src- The long integerhexChars- The character array to store the result
-
toHexString
public static void toHexString(byte[] bytes, int offset, int endIndex, AString hexChars)Converts a byte array to a hexadecimal string with a specified offset and end index.- Parameters:
bytes- The byte arrayoffset- The starting indexendIndex- The ending index (exclusive)hexChars- The character array to store the result
-
toHexString
public static void toHexString(int bytes, char[] hexChars, int destOffset)Converts an integer to a hexadecimal string with a specified destination array and offset.- Parameters:
bytes- The integerhexChars- The character array to store the resultdestOffset- The starting position in the destination array
-
toHexString
public static void toHexString(long bytes, char[] hexChars, int destOffset)Converts a long integer to a hexadecimal string with a specified destination array and offset.- Parameters:
bytes- The long integerhexChars- The character array to store the resultdestOffset- The starting position in the destination array
-
-