Here you can find the source of bigIntegerToString(final BigInteger value)
Parameter | Description |
---|---|
value | value to be converted |
value
public static String bigIntegerToString(final BigInteger value)
//package com.java2s; /* Util.java//from www . j a v a 2 s . com * * Copyright (C) 2015, Tom? Pecina <tomas@pecina.cz> * * This file is part of cz.pecina.bin, a suite of binary-file * processing applications. * * This application is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This application is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import java.math.BigInteger; public class Main { /** * Customized string representation of BigInteger. * * @param value value to be converted * @return string representatioin of <code>value</code> */ public static String bigIntegerToString(final BigInteger value) { if (value == null) { return "null"; } else if (value.signum() < 0) { return "-0x" + value.negate().toString(16); } else { return "0x" + value.toString(16); } } @Override public String toString() { return "Util"; } }