MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / hex

Method hex

src/Bytes.java:414–427  ·  view source on GitHub ↗

Pretty-prints a long into a fixed-width hexadecimal number. @return A string of the form 0x0123456789ABCDEF.

(long v)

Source from the content-addressed store, hash-verified

412 * @return A string of the form {@code 0x0123456789ABCDEF}.
413 */
414 public static String hex(long v) {
415 final byte[] buf = new byte[2 + 16];
416 buf[0] = '0';
417 buf[1] = 'x';
418 int i = 2 + 16;
419 do {
420 buf[--i] = HEX[(int) v & 0x0F];
421 v >>>= 4;
422 } while (v != 0);
423 for (/**/; i > 1; i--) {
424 buf[i] = '0';
425 }
426 return new String(buf);
427 }
428
429 // Ugly stuff
430 // ----------

Callers 6

callMethod · 0.95
toStringMethod · 0.95
toStringMethod · 0.95
toStringMethod · 0.95
toStringMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected