Java Byte Array to Hex byteToHexWord(byte in)

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

Description

byte To Hex Word

License

Apache License

Declaration

public static final int byteToHexWord(byte in) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static final int byteToHexWord(byte in) {

        byte[] table = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45,
                0x46 };//from w  ww.j  a va 2 s.c o  m
        int result = 0x0000;

        result = (table[(in & 0xF0) >>> 4]) << 8;
        result = (result & 0xFF00) | (table[in & 0x0F]);

        return result;
    }
}

Related

  1. byteToHex(final byte b)
  2. bytetoHex(final byte data, final StringBuffer buffer)
  3. byteToHex(int val)
  4. byteToHex(int val, StringBuffer sb)
  5. byteToHexDisplayString(byte[] b)
  6. byteToLowerHex(final byte b)
  7. byteToTwoHexString(final byte data)