Java hex decimal 转换

package com.tv.ui.metro.utils;

import java.math.BigInteger;

/**
* Created by Administrator on 16-4-9.
*/
public class NumberConverter {
public static Long HexToLongDecimal(String s) {
return Long.parseLong(s, 16);
}

public static BigInteger HexToBigIntDecimal(String s) {
return new BigInteger(s, 16);
}

public static String LongDecimalToHex(Long l) {
return Long.toHexString(l);
}

public static String BigIntDecimalToHex(String s) {
return new BigInteger(s, 10).toString(10);
}
}
posted @ 2016-04-09 10:20  the_World  阅读(584)  评论(0)    收藏  举报