Java Byte Array to Hex bytes2Hex(byte[] bts)

Here you can find the source of bytes2Hex(byte[] bts)

Description

bytes Hex

License

Open Source License

Declaration

private static String bytes2Hex(byte[] bts) 

Method Source Code

//package com.java2s;

public class Main {
    private static String bytes2Hex(byte[] bts) {
        String des = "";
        String tmp = null;/*from  w  ww.j  av a  2s  .com*/
        for (int i = 0; i < bts.length; i++) {
            tmp = (Integer.toHexString(bts[i] & 0xFF));
            if (tmp.length() == 1) {
                des += "0";
            }
            des += tmp;
        }
        return des;
    }
}

Related

  1. bytes2Hex(byte... values)
  2. bytes2Hex(byte[] abValue)
  3. bytes2Hex(byte[] b)
  4. bytes2Hex(byte[] b)
  5. bytes2Hex(byte[] bts)
  6. bytes2Hex(byte[] byteArray)
  7. bytes2Hex(byte[] bytes)
  8. bytes2Hex(byte[] bytes)
  9. bytes2Hex(byte[] bytes)