Java Hex Calculate toHexString(byte[] paramArrayOfByte, String paramString, boolean paramBoolean)

Here you can find the source of toHexString(byte[] paramArrayOfByte, String paramString, boolean paramBoolean)

Description

to Hex String

License

Open Source License

Declaration

public static String toHexString(byte[] paramArrayOfByte, String paramString, boolean paramBoolean) 

Method Source Code

//package com.java2s;

public class Main {
    public static String toHexString(byte[] paramArrayOfByte, String paramString, boolean paramBoolean) {
        StringBuilder localStringBuilder = new StringBuilder();
        int i = paramArrayOfByte.length;
        for (int j = 0; j < i; j++) {
            String str = Integer.toHexString(0xFF & paramArrayOfByte[j]);
            if (paramBoolean)
                str = str.toUpperCase();
            if (str.length() == 1)
                localStringBuilder.append("0");
            localStringBuilder.append(str).append(paramString);
        }/*from  www  .j ava  2 s.c  o  m*/
        return localStringBuilder.toString();
    }
}

Related

  1. toHexString(byte[] in)
  2. toHexString(byte[] input)
  3. toHexString(byte[] md)
  4. toHexString(byte[] messagePayload)
  5. toHexString(byte[] paramArrayOfByte)
  6. toHexString(byte[] raw)
  7. toHexString(byte[] raw)
  8. toHexString(byte[] src)
  9. toHexString(byte[] v)