Java Base Encode ToBase16(StringBuilder str, byte[] data)

Here you can find the source of ToBase16(StringBuilder str, byte[] data)

Description

To Base

License

Creative Commons License

Declaration

public static void ToBase16(StringBuilder str, byte[] data) 

Method Source Code

//package com.java2s;

public class Main {
    private static final String HexAlphabet = "0123456789ABCDEF";

    public static void ToBase16(StringBuilder str, byte[] data) {
        if (data == null) {
            throw new NullPointerException("data");
        }//from  ww w  . j av  a2s. c  o m
        int length = data.length;
        for (int i = 0; i < length; ++i) {
            str.append(HexAlphabet.charAt((data[i] >> 4) & 15));
            str.append(HexAlphabet.charAt(data[i] & 15));
        }
    }
}

Related

  1. toBase10(int[] arr)
  2. toBase10(int[] arr)
  3. toBase10SuffixedString(long n)
  4. toBase16(byte[] data)
  5. toBase16(int[] arr)
  6. toBase2(byte b)
  7. toBase26(int number)
  8. toBase2SuffixedString(long n)
  9. toBase32Char(int i)