Java Byte Array Dump dumpBytes(byte[] data)

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

Description

dump Bytes

License

Apache License

Declaration

public static final String dumpBytes(byte[] data) 

Method Source Code

//package com.java2s;
/*/*from   w ww  .  j a v  a 2  s  . co m*/
 * This file is part of jsFlow.
 *
 * Copyright (c) 2009 DE-CIX Management GmbH <http://www.de-cix.net> - All rights
 * reserved.
 * 
 * Author: Thomas King <thomas.king@de-cix.net>
 *
 * This software is licensed under the Apache License, version 2.0. A copy of 
 * the license agreement is included in this distribution.
 */

public class Main {
    public static final String dumpBytes(byte[] data) {
        StringBuilder sb = new StringBuilder();
        int i = 0;
        for (byte b : data) {
            i++;
            sb.append(String.valueOf(b));
            if (i < data.length)
                sb.append(", ");
            if ((i % 15) == 0)
                sb.append("\n");
        }
        return sb.toString();
    }
}

Related

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