KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sleepycat > je > utilint > HexFormatter


1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 2002,2006 Oracle. All rights reserved.
5  *
6  * $Id: HexFormatter.java,v 1.11 2006/10/30 21:14:28 bostic Exp $
7  */

8
9 package com.sleepycat.je.utilint;
10
11 public class HexFormatter {
12     static public String JavaDoc formatLong(long l) {
13     StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
14     sb.append(Long.toHexString(l));
15     sb.insert(0, "0000000000000000".substring(0, 16 - sb.length()));
16     sb.insert(0, "0x");
17     return sb.toString();
18     }
19 }
20
Popular Tags