public class CodeAreaUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static char[] |
LOWER_HEX_CODES |
static char[] |
UPPER_HEX_CODES |
Constructor and Description |
---|
CodeAreaUtils() |
Modifier and Type | Method and Description |
---|---|
static char[] |
byteToHexChars(byte value)
Converts byte value to sequence of hexadecimal characters.
|
static void |
byteToHexChars(char[] target,
byte value)
Converts byte value to sequence of two hexadecimal characters.
|
static void |
byteToCharsCode(byte dataByte,
CodeType codeType,
char[] targetData,
int targetPosition,
HexCharactersCase charCase)
Converts byte value to sequence of characters of given code type.
|
static int |
longToBaseCode(char[] target,
int targetOffset,
long value,
int base,
int lengthLimit,
boolean fillZeros,
boolean upperCase)
Converts long value to code of given base and length limit.
|
static void |
longToHexChars(char[] target,
long value,
int length)
Converts long value to sequence of hexadecimal character.
|
static char[] |
longToHexChars(long value,
int length)
Converts long value to sequence of hexadecimal character.
|
static byte |
stringCodeToByte(java.lang.String code,
CodeType codeType)
Converts string of characters to byte value.
|
public static final char[] UPPER_HEX_CODES
public static final char[] LOWER_HEX_CODES
public static char[] byteToHexChars(byte value)
value
- byte valuepublic static void byteToHexChars(char[] target, byte value)
target
- target char arrayvalue
- byte valuepublic static char[] longToHexChars(long value, int length)
value
- long valuelength
- length of the target sequencepublic static void longToHexChars(char[] target, long value, int length)
target
- target char arrayvalue
- long valuelength
- length of the target sequencepublic static void byteToCharsCode(byte dataByte, CodeType codeType, char[] targetData, int targetPosition, HexCharactersCase charCase)
dataByte
- byte valuecodeType
- code typetargetData
- target array of characterstargetPosition
- target position in array of characterscharCase
- case type for alphabetical characterspublic static byte stringCodeToByte(java.lang.String code, CodeType codeType)
code
- source text stringcodeType
- code typejava.lang.IllegalArgumentException
- if code is invalidpublic static int longToBaseCode(char[] target, int targetOffset, long value, int base, int lengthLimit, boolean fillZeros, boolean upperCase)
target
- target characters arraytargetOffset
- offset position in target arrayvalue
- valuebase
- target numerical base, supported values are 1 to 16lengthLimit
- length limitfillZeros
- flag if rest of the value should be filled with zerosupperCase
- upper case for values greater than 9