Java Hex Calculate toHexString(byte[] ba)

Here you can find the source of toHexString(byte[] ba)

Description

to Hex String

License

Apache License

Declaration

private static String toHexString(byte[] ba) 

Method Source Code

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

public class Main {
    private static String toHexString(byte[] ba) {
        StringBuilder str = new StringBuilder();
        for (int i = 0; i < ba.length; i++) {
            str.append(String.format("%x", new Object[] { Byte.valueOf(ba[i]) }));
        }//  w w  w . jav  a  2s  . co m
        return str.toString();
    }
}

Related

  1. toHexString(byte[] b)
  2. toHexString(byte[] b)
  3. toHexString(byte[] b)
  4. toHexString(byte[] b, int off, int len)
  5. toHexString(byte[] b, int off, int len)
  6. toHexString(byte[] ba)
  7. toHexString(byte[] ba, int offset, int length)
  8. toHexString(byte[] binary)
  9. toHexString(byte[] binaryData)