Java Hex Calculate toHex(byte in)

Here you can find the source of toHex(byte in)

Description

to Hex

License

Open Source License

Declaration

private static byte toHex(byte in) 

Method Source Code

//package com.java2s;

public class Main {
    private static byte toHex(byte in) {
        if (in >= '0' && in <= '9') {
            return (byte) (in - '0');
        } else if (in >= 'A' && in <= 'F') {
            return (byte) (in - 'A');
        } else if (in >= 'a' && in <= 'f') {
            return (byte) (in - 'a');
        }/*from  w  w  w. j ava  2  s .c  o  m*/
        return in;
    }
}

Related

  1. toHex(byte b, char[] charArray, int from)
  2. toHex(byte b, String prefix)
  3. toHex(byte bytes[])
  4. toHex(byte data[])
  5. toHex(byte hash[])
  6. toHex(byte in[])
  7. toHex(byte in[])
  8. toHex(byte input[])
  9. toHex(byte lowByte)