Java Hex Calculate toHex(StringBuilder s, byte b)

Here you can find the source of toHex(StringBuilder s, byte b)

Description

to Hex

License

Open Source License

Declaration

public static void toHex(StringBuilder s, byte b) 

Method Source Code

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

public class Main {
    public static void toHex(StringBuilder s, byte b) {
        char hi = Character.forDigit((b >> 4) & 0x0F, 16);
        char lo = Character.forDigit(b & 0x0F, 16);
        s.append(Character.toUpperCase(hi));
        s.append(Character.toUpperCase(lo));
    }// ww w.j ava2  s .  c o m
}

Related

  1. toHex(String str)
  2. toHex(String string)
  3. toHex(String txt)
  4. toHex(String val)
  5. toHex(StringBuffer buf, long value, int width)
  6. toHex00String(int c)
  7. toHEX1(byte b)
  8. toHex16(int w)
  9. toHex16(long l)