Java Byte Array Print printBytes(byte[] ba)

Here you can find the source of printBytes(byte[] ba)

Description

print Bytes

License

Open Source License

Declaration

public static void printBytes(byte[] ba) 

Method Source Code

//package com.java2s;

public class Main {
    public static void printBytes(byte[] ba, boolean doHex) {
        String format = doHex ? "0x%x " : "%d ";
        for (byte b : ba) {
            System.out.printf(format, b);
        }//w  ww .ja v  a2  s.  c  om
    }

    public static void printBytes(byte[] ba) {
        printBytes(ba, false);
    }
}

Related

  1. printByteArray(byte[] bytes)
  2. printByteArray(byte[] input)
  3. printByteArrayAsChars(byte[] bytes)
  4. printByteArrayToHex(byte[] byteArray, int length)
  5. printByteHexEncoded(byte b)
  6. printBytes(byte[] buffer, int start, int length)
  7. printBytes(byte[] bytes)
  8. printBytes(byte[] bytes)
  9. printBytes(byte[] bytes)