Java Byte to Hex byteToHex(final byte value)

Here you can find the source of byteToHex(final byte value)

Description

byte To Hex

License

Open Source License

Declaration

public static String byteToHex(final byte value) 

Method Source Code

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

public class Main {
    public static String byteToHex(final byte value) {
        if ((value & 0xFF) < 16) {
            return "0" + Integer.toHexString(value & 0xFF);
        } else {/* w w  w  .  jav a 2 s .  c  om*/
            return Integer.toHexString(value & 0xFF);
        }
    }
}

Related

  1. byteToHex(byte[] data)
  2. byteToHex(char val)
  3. byteToHex(final byte b)
  4. byteToHex(final byte b)
  5. byteToHex(final byte b, StringBuilder buffer)
  6. byteToHex(final byte value, final int minLength)
  7. byteToHex(final byte[] data)
  8. byteToHex(int v)