Here you can find the source of getLong(byte[] data)
private static long getLong(byte[] data)
//package com.java2s; import javax.xml.bind.DatatypeConverter; public class Main { private static long getLong(byte[] data) { if (data != null) { try { String dataTypeS = DatatypeConverter.printHexBinary(data); long dataType_num = Long.parseLong(dataTypeS, 16); return dataType_num; } catch (IllegalArgumentException e) { e.printStackTrace();//from w w w . ja va 2 s. co m } } return 0; } }