public class HexConverter extends Object
Constructor and Description |
---|
HexConverter() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
convertFromHex(char[] toConvert)
Take the incoming character of hex encoded data and convert to the raw byte values.
|
static byte[] |
convertFromHex(String toConvert)
Take the incoming String of hex encoded data and convert to the raw byte values.
|
static byte[] |
convertToHexBytes(byte[] toBeConverted)
Take the supplied byte array and convert it to to a byte array of the encoded
hex values.
|
static String |
convertToHexString(byte[] toBeConverted)
Take the supplied byte array and convert it to a hex encoded String.
|
static void |
main(String[] args) |
public static String convertToHexString(byte[] toBeConverted)
toBeConverted
- - the bytes to be converted.public static byte[] convertToHexBytes(byte[] toBeConverted)
Each byte on the incoming array will be converted to two bytes on the return array.
toBeConverted
- - the bytes to be encoded.public static byte[] convertFromHex(char[] toConvert)
The characters in the incoming array are processed in pairs with two chars of a pair being converted to a single byte.
toConvert
- - the hex encoded String to convert.public static byte[] convertFromHex(String toConvert)
The characters in the incoming String are processed in pairs with two chars of a pair being converted to a single byte.
toConvert
- - the hex encoded String to convert.public static void main(String[] args)
Copyright © 2016 JBoss by Red Hat. All rights reserved.