Java Hex Calculate toHexChar(int i)

Here you can find the source of toHexChar(int i)

Description

Standard algorithm to convert an int into a hex char.

License

Open Source License

Declaration

@Deprecated
public static char toHexChar(int i) 

Method Source Code

//package com.java2s;
/*/*from w  w w  .j a  va 2s.  c  o m*/
 *   $Id$
 *
 *   Copyright 2006 University of Dundee. All rights reserved.
 *   Use is subject to license terms supplied in LICENSE.txt
 */

public class Main {
    /**
     * Standard algorithm to convert an int into a hex char.
     * @deprecated As of 4.4.7,
     *             superseded by the use of <code>commons.codec.binary.Hex</code>
     */
    @Deprecated
    public static char toHexChar(int i) {
        if (0 <= i && i <= 9) {
            return (char) ('0' + i);
        } else {
            return (char) ('a' + i - 10);
        }
    }
}

Related

  1. toHexChar(int digit)
  2. toHexChar(int digitValue)
  3. toHexChar(int digitValue)
  4. toHexChar(int i)
  5. toHexChar(int i)
  6. toHexChar(int nibble)
  7. toHexChar(int paramInt)
  8. toHexChar(int value)
  9. toHexCharArray(byte[] input)