Java Byte Array Print printBytes(byte[] bytes)

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

Description

print Bytes

License

Open Source License

Declaration

public static void printBytes(byte[] bytes) 

Method Source Code

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

public class Main {
    public static void printBytes(byte[] bytes) {
        printBytes(bytes, 0, bytes.length);
    }/* www  .java2s  .  c  o m*/

    public static void printBytes(byte[] bytes, int length) {
        printBytes(bytes, 0, length);
    }

    public static synchronized void printBytes(byte[] bytes, int start, int length) {
        System.err.println(Thread.currentThread().getName() + ">>>>>>>>>>>");
        for (int i = start; i < length; i++) {
            if (i > 0 && i % 32 == 0)
                System.err.println();
            int p = bytes[i] & 0xFF;
            if (p < 16)
                System.err.print("0");
            System.err.print(Integer.toHexString(p).toUpperCase());
            System.err.print(" ");
        }
        System.err.println();
    }
}

Related

  1. printBytes(byte[] ba)
  2. printBytes(byte[] buffer, int start, int length)
  3. printBytes(byte[] bytes)
  4. printBytes(byte[] bytes)
  5. printBytes(byte[] bytes)
  6. printBytes(byte[] bytes, int offset)
  7. printBytes(byte[] data)
  8. printBytes(String comment, byte[] input)
  9. printBytes(String x)