Android Hex String Create toHex(byte[] bytes)

Here you can find the source of toHex(byte[] bytes)

Description

to Hex

License

Open Source License

Declaration

private static String toHex(byte[] bytes) 

Method Source Code

//package com.java2s;
//  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of

import java.math.BigInteger;

public class Main {
    private static String toHex(byte[] bytes) {
        BigInteger bi = new BigInteger(1, bytes);
        return String.format("%0" + (bytes.length << 1) + "X", bi);
    }/*from  ww  w.  j ava2s  . c o  m*/
}

Related

  1. hexify(byte bytes[])
  2. toHex(String str)
  3. toHex(String txt)
  4. toHex(byte b)
  5. toHex(byte input[])
  6. toHex(byte[] data)
  7. toHex(int address)
  8. toHexByte(String str, int offset, int length)
  9. toHexChar(int i)