Java Byte Array Dump dumpBytes(byte[] bytes)

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

Description

dump Bytes

License

Open Source License

Declaration

public static String dumpBytes(byte[] bytes) 

Method Source Code

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

public class Main {
    public static String dumpBytes(byte[] bytes) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < bytes.length; i++) {
            int unsignedInt = 0xFF & bytes[i];
            if (unsignedInt < 0x10) {
                sb.append("0");
            }//from  w  w w.ja va 2  s  . co m
            sb.append(Integer.toHexString(unsignedInt));
        }
        return sb.toString();
    }
}

Related

  1. dumpBytes(byte[] b)
  2. dumpBytes(byte[] buffer)
  3. dumpBytes(byte[] buffer)
  4. dumpBytes(byte[] bytes)
  5. dumpBytes(byte[] bytes)
  6. dumpBytes(byte[] bytes, int maxLen)
  7. dumpBytes(byte[] bytes, int start, int length)
  8. dumpBytes(byte[] byts, int offset, int length)
  9. dumpBytes(byte[] data)