Here you can find the source of convertHexTime2Binary(String timespan)
public static String convertHexTime2Binary(String timespan)
//package com.java2s; //License from project: Apache License public class Main { public static String convertHexTime2Binary(String timespan) { if (timespan == null || timespan.equals("")) { return ""; }/*from ww w .j a va2 s . c o m*/ String tmp = ""; String ret = ""; String[] strArr = timespan.split(","); for (int i = 0; i < strArr.length; i++) { String binStr = Long.toBinaryString(Long.parseLong(strArr[i], 16)); if (binStr.length() < 32) { int length = binStr.length(); for (int n = 0; n < 32 - length; n++) { binStr = "0" + binStr; } } tmp += binStr; } for (int i = 0; i < 48; i++) { ret += tmp.charAt(i * 2); } return ret; } }