public String formatAsString() { StringBuilder sb = new StringBuilder(36); int PREFIX_LEN = "0x".length(); sb.append(HexDump.intToHex(_d1), PREFIX_LEN, 8); sb.append("-"); sb.append(HexDump.shortToHex(_d2), PREFIX_LEN, 4); sb.append("-"); sb.append(HexDump.shortToHex(_d3), PREFIX_LEN, 4); sb.append("-"); char[] d4Chars = HexDump.longToHex(getD4()); sb.append(d4Chars, PREFIX_LEN, 4); sb.append("-"); sb.append(d4Chars, PREFIX_LEN + 4, 12); return sb.toString(); }
private static String formatDoubleAsHex(double d) { long l = Double.doubleToLongBits(d); StringBuilder sb = new StringBuilder(20); sb.append(HexDump.longToHex(l)).append('L'); return sb.toString(); }