Java Array Dump dumpData(byte data[])

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

Description

Dump an array of bytes

License

Apache License

Parameter

Parameter Description
data The data to dump

Return

A string representation of the data.

Declaration

public static String dumpData(byte data[]) 

Method Source Code

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

public class Main {
    /**//from   w  w  w  .j av a 2 s.  co m
     * Dump an array of bytes
     * @param data The data to dump
     * @return A string representation of the data.
     */
    public static String dumpData(byte data[]) {
        String ret = "";
        for (int i = 0; i < data.length; i++) {
            ret += String.format("%2x", data[i]).replace(' ', '0') + " ";
        }
        return ret;
    }
}

Related

  1. dumpArrayHex(byte b[])
  2. dumpAsciiChars(byte[] b, int blen)
  3. dumpAsHex(byte[] byteBuffer, int length)
  4. dumpAsHex(byte[] src, int length)
  5. dumpCharCharArray(String msg, char[][] o)
  6. dumpFirst1024Byte(byte[] data)
  7. dumpGroups(String title, int[][] allGroups)
  8. dumpHex(byte[] data, int offset, int length)
  9. dumpHexString(final byte[] array)