public class HexaDecoder extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
byteToHex(byte b)
A custom decoding function usable for Debugging.
|
static byte[] |
decode(String s)
Decodes a byte array from an hexadecimal String format.
|
static String |
encode(byte[] in)
Encodes a byte array into an hexadecimal String format.
|
static String |
encode(byte[] in,
int length)
Encodes a byte array into an hexadecimal String format.
|
static int |
getSizeInBits(int value)
Return the size in bits of an hexadecimal value.
|
static byte |
parseByte(String byteS)
Parse a byte expressed as a byte, or as an hexadecimal value, in the format 0x<hexadecimal digits>.
|
static char |
parseChar(String charS)
Parse a char expressed as a char value, or as an hexadecimal value, in the format 0x<hexadecimal digits>.
|
static double |
parseDouble(String doubleS)
Parse a double expressed as a double value, or as an hexadecimal value, in the format 0x<hexadecimal digits>.
|
static float |
parseFloat(String floatS)
Parse a float expressed as a float value, or as an hexadecimal value, in the format 0x<hexadecimal digits>.
|
static int |
parseInt(String intS)
Parse an int expressed as an int value, or as an hexadecimal value, in the format 0x<hexadecimal digits>.
|
static long |
parseLong(String longS)
Parse a long expressed as a long, or as an hexadecimal value, in the format 0x<hexadecimal digits>.
|
static short |
parseShort(String shortS)
Parse a short expressed as a short, or as an hexadecimal value, in the format 0x<hexadecimal digits>.
|
static String |
toHexString(int value)
Return the hexadecimal String corresponding to an int value, in the format 0x<Hexa string>
|
static String |
toHexString(long value)
Return the hexadecimal String corresponding to a long value, in the format 0x<Hexa string>
|
public static float parseFloat(String floatS) throws NumberFormatException
floatS - the float value as a StringNumberFormatExceptionpublic static double parseDouble(String doubleS) throws NumberFormatException
doubleS - the double value as a StringNumberFormatExceptionpublic static int parseInt(String intS) throws NumberFormatException
intS - the int value as a StringNumberFormatExceptionpublic static char parseChar(String charS) throws NumberFormatException
charS - the char value as a charNumberFormatExceptionpublic static long parseLong(String longS) throws NumberFormatException
longS - the long value as a StringNumberFormatExceptionpublic static short parseShort(String shortS) throws NumberFormatException
shortS - the short value as a StringNumberFormatExceptionpublic static byte parseByte(String byteS) throws NumberFormatException
byteS - the byte value as a StringNumberFormatExceptionpublic static String encode(byte[] in)
in - a String containing the data bytes to be encodedpublic static int getSizeInBits(int value)
value - the hexadecimal valuepublic static String toHexString(int value)
value - the value as an intpublic static String toHexString(long value)
value - the value as a longpublic static String encode(byte[] in, int length)
in - an array containing the data bytes to be encodedlength - number of bytes to process in inpublic static byte[] decode(String s)
s - an hexadecimal String to be decoded.IllegalArgumentException - if the input is not valid hexadecimal String format encoded datapublic static String byteToHex(byte b)
b - the byte