Here you can find the source of getAddressText(BigInteger address)
public static String getAddressText(BigInteger address)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors://from ww w . j a v a2 s . c o m * Wind River Systems - initial API and implementation * Freescale Semiconductor - refactoring *******************************************************************************/ import java.math.BigInteger; public class Main { public static String getAddressText(BigInteger address) { if (address == null) { return "<null>"; //$NON-NLS-1$ } if (address.compareTo(BigInteger.ZERO) < 0) { return address.toString(); } String hex = address.toString(16); return "0x" + "0000000000000000".substring(hex.length() + (address.bitLength() <= 32 ? 8 : 0)) + hex; //$NON-NLS-1$ //$NON-NLS-2$ } }