Java Hex Calculate toHexByte(byte b)

Here you can find the source of toHexByte(byte b)

Description

to Hex Byte

License

Open Source License

Declaration

public static String toHexByte(byte b) 

Method Source Code

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

public class Main {
    public static String toHexByte(byte b) {
        return String.format("0x%02X", b & 0xFF);
    }/*from ww  w .  j a va2s. c o  m*/

    public static String toHexByte(int b) {
        return String.format("0x%02X", b);
    }
}

Related

  1. toHexadecimal(final byte[] message)
  2. toHexadecimealString(byte[] data, int length, boolean uppercase)
  3. toHexArray(byte[] binary)
  4. toHexaString(byte[] data)
  5. toHexaString(int value)
  6. toHexByte(byte b, StringBuffer sb)
  7. toHexByte(final char ch1, final char ch2)
  8. toHexByte(int bite)
  9. toHexByte(int i)