Ejemplo n.º 1
0
    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();
    }
Ejemplo n.º 2
0
 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();
 }