public class StringConversionHelper extends Object
Modifier and Type | Method and Description |
---|---|
static String |
bytesToHex(byte[] bytes)
Converts a byte array into a hexadecimal string with default settings (lowercase, no spacing).
|
static String |
bytesToHex(byte[] bytes,
boolean lowerCase)
Converts a byte array into a hexadecimal string.
|
static String |
bytesToHex(byte[] bytes,
boolean lowerCase,
String spacing)
Converts a byte array into a hexadecimal string.
|
static String |
longToByteString(long value)
Converts a long integer a hexadecimal string.
|
static String |
longToByteString(long value,
boolean lowerCase)
Converts a long integer a hexadecimal string.
|
static String |
shortsToHex(int[] shorts)
Converts an array of shorts (contained in integers) into a hexadecimal string with default lowercase.g.
|
static String |
shortsToHex(int[] shorts,
boolean lowerCase)
Converts an array of shorts into a hexadecimal string.
|
public static String bytesToHex(byte[] bytes)
bytes
- The byte array to convertpublic static String bytesToHex(byte[] bytes, boolean lowerCase)
bytes
- The byte array to convertlowerCase
- Whether the hex characters should be lowercasepublic static String bytesToHex(byte[] bytes, boolean lowerCase, String spacing)
bytes
- The byte array to convertlowerCase
- Whether the hex characters should be lowercasespacing
- String added between each hex value (e.g., " " for space)public static String shortsToHex(int[] shorts)
shorts
- Array of short values (each stored as int)public static String shortsToHex(int[] shorts, boolean lowerCase)
shorts
- Array of short values (each stored as int)lowerCase
- Whether hex characters should be lowercasepublic static String longToByteString(long value)
value
- Long value to convertpublic static String longToByteString(long value, boolean lowerCase)
value
- Long value to convertlowerCase
- Whether hex characters should be lowercaseCopyright © 2020–2025 Stiftung SIC. All rights reserved.