@Test public void testToLong() { String dpidStr = "3e:1f:01:fc:72:8c:63:31"; long valid = 0x3e1f01fc728c6331L; long testLong = HexString.toLong(dpidStr); TestCase.assertEquals(valid, testLong); }
public static long toLong(String values) throws NumberFormatException { BigInteger bi = new BigInteger(values.replaceAll(":", ""),16); if (bi.bitLength() > 64) throw new NumberFormatException("Input string too big to fit in long: " + values); return bi.longValue(); }
HexString { public static long toLong(String values) throws NumberFormatException { BigInteger bi = new BigInteger(values.replaceAll(":", ""),16); if (bi.bitLength() > 64) throw new NumberFormatException("Input string too big to fit in long: " + values); return bi.longValue(); } }
HexString { public static long toLong(String values) throws NumberFormatException { BigInteger bi = new BigInteger(values.replaceAll(":", ""),16); if (bi.bitLength() > 64) throw new NumberFormatException("Input string too big to fit in long: " + values); return bi.longValue(); }  }
HexString { public static long toLong(String values) throws NumberFormatException { BigInteger bi = new BigInteger(values.replaceAll(":", ""),16); if (bi.bitLength() > 64) throw new NumberFormatException("Input string too big to fit in long: " + values); return bi.longValue(); }  static String toHexString(byte[] bytes); static String toHexString(long val, int padTo); static String toHexString(long val); static byte[] fromHexString(String values); static long toLong(String values); }
HexString { public static long toLong(String values) throws NumberFormatException { BigInteger bi = new BigInteger(values.replaceAll(":", ""),16); if (bi.bitLength() > 64) throw new NumberFormatException("Input string too big to fit in long: " + values); return bi.longValue(); }  static String toHexString(byte[] bytes); static String toHexString(long val, int padTo); static String toHexString(long val); static byte[] fromHexString(String values); static long toLong(String values);  }