public static String toString(long l, boolean escape) {
    byte[] octets = new byte[8];
    StringBuilder sb = new StringBuilder();
    for ( int i = 7; i >= 0; --i ) {
      octets[i] = (byte) (l & 0xFF);
      l >>= 8;
    }
    for ( int i = 0; i < 8; ++i ) {
      if ( i > 0 ) {
	sb.append(escape ? "%3A" : ":");
      }
      String s = String.format("%02X", octets[i]);
      sb.append(s);
    }
    return sb.toString();
  }