Java Array Dump dumpFirst1024Byte(byte[] data)

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

Description

Dump the first 1024 byte of an byte-array.

License

Open Source License

Parameter

Parameter Description
data a parameter

Return

data - first 1024 byte or empty array if was shorter than 1024 byte.

Declaration

public static byte[] dumpFirst1024Byte(byte[] data) 

Method Source Code

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

public class Main {
    /**/*from w ww  . ja  va 2  s . c  o m*/
     * Dump the first 1024 byte of an byte-array. Approximation to remove a
     * Riff-wave header.
     * 
     * @param data
     * @return data - first 1024 byte or empty array if was shorter than 1024
     *         byte.
     */
    public static byte[] dumpFirst1024Byte(byte[] data) {
        byte[] ret = new byte[0];
        if (data.length >= 1024) {
            ret = new byte[data.length - 1024];
            System.arraycopy(data, 1024, ret, 0, data.length - 1024);
        }
        return ret;
    }
}

Related

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