* @return The hexadecimal representation of the byte array. If bytes is
* null, "null" string is returned
*/
- public static String bytesToHexString(byte[] bytes) {
+ public static String bytesToHexString(final byte[] bytes) {
if (bytes == null) {
return "null";
return ret;
}
- public static String longToHexString(long val) {
+ public static String longToHexString(final long val) {
char arr[] = Long.toHexString(val).toCharArray();
StringBuffer buf = new StringBuffer();
// prepend the right number of leading zeros
}
- public static byte[] bytesFromHexString(String values) {
+ public static byte[] bytesFromHexString(final String values) {
String target = "";
if (values != null) {
target = values;
return ret;
}
- public static long stringToLong(String values) {
+ public static long stringToLong(final String values) {
long value = new BigInteger(values.replaceAll(":", ""), 16).longValue();
return value;
}
/**
* This method converts byte array into HexString format with ":" inserted.
*/
- public static String bytesToHexStringFormat(byte[] bytes) {
+ public static String bytesToHexStringFormat(final byte[] bytes) {
if (bytes == null) {
return "null";
}