Java Unsigned Number Create unsignedIntToHex(int i)

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

Description

unsigned Int To Hex

License

Open Source License

Declaration

private static char unsignedIntToHex(int i) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static char unsignedIntToHex(int i) {
        if (i >= 0 && i <= 9) {
            return (char) (i + 48);
        } else if (i >= 10 && i <= 15) {
            return (char) (i + 87);
        } else {/*  w  w w  . java 2  s. com*/
            throw new IllegalArgumentException(
                    "Invalid hex int: out of range");
        }
    }
}

Related

  1. unsignedInt32ToBytes(long v)
  2. unsignedIntArray2signedIntArray(int[] myIntArray, int numberOfBytes)
  3. unsignedIntersect2by2(final short[] set1, final int length1, final short[] set2, final int length2, final short[] buffer)
  4. unsignedIntersects(short[] set1, int length1, short[] set2, int length2)
  5. unsignedIntToByteArray(long value)
  6. unsignedIntToInt(byte[] b)
  7. unsignedIntToLong(byte[] b)
  8. unsignedIntToLong(byte[] b)
  9. unsignedIntToLong(byte[] bytes)