Android Byte Array to Hex Convert encodeHex(byte[] data)

Here you can find the source of encodeHex(byte[] data)

Description

encode Hex

License

Open Source License

Declaration

private static String encodeHex(byte[] data) 

Method Source Code

//package com.java2s;
// Use of this source code is governed by a BSD-style license that can be

import java.util.Formatter;

public class Main {
    private static String encodeHex(byte[] data) {
        StringBuilder sb = new StringBuilder(data.length * 2);
        Formatter formatter = new Formatter(sb);
        for (byte b : data) {
            formatter.format("%02x", b);
        }/*from w ww. java 2 s .c  om*/
        return sb.toString();
    }
}

Related

  1. convertToHex(byte[] data)
  2. convertToHex(byte[] data)
  3. convertToHex(byte[] data)
  4. convertToHexString(byte[] b)
  5. encodeHex(byte[] data)
  6. convertToHex(byte[] data)
  7. byteArrayToHexString(byte[] array)
  8. byteArrayToHexString(byte[] b)
  9. byteArrayToHexString(byte[] byteArray)