Java Array Dump dumpArrayHex(byte b[])

Here you can find the source of dumpArrayHex(byte b[])

Description

dump Array Hex

License

Open Source License

Declaration

public static String dumpArrayHex(byte b[]) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String dumpArrayHex(byte b[]) {
        return dumpArrayHex(b, 0, b.length);
    }//from   w  ww  . j a  v a2s . c  o m

    public static String dumpArrayHex(byte b[], int pos, int len) {
        StringBuilder sb = new StringBuilder();
        sb.append('[');
        for (int i = pos; i < len; i++) {
            if (i > 0)
                sb.append(",");
            sb.append(Integer.toHexString(b[i] & 0xff));
        }
        sb.append(']');
        return sb.toString();
    }
}

Related

  1. dump_strarr(String[] arr, String doc)
  2. dumpArray(final float[] array, final int maxElemsPerLine)
  3. dumpArray(String msg, float[][] A, int x1, int x2, int y1, int y2)
  4. dumpArray(String msg, Object[] refs)
  5. dumpArray(T[] ts)
  6. dumpAsciiChars(byte[] b, int blen)
  7. dumpAsHex(byte[] byteBuffer, int length)
  8. dumpAsHex(byte[] src, int length)
  9. dumpCharCharArray(String msg, char[][] o)