Here you can find the source of copyByteArray(final byte[] src, byte[] dest, int length)
Parameter | Description |
---|---|
src | the source array. |
dest | the destination array. |
length | the number of array elements to be copied. |
public static void copyByteArray(final byte[] src, byte[] dest, int length)
//package com.java2s; //License from project: BSD License public class Main { /**/*from w ww . ja va 2 s . c o m*/ * Same as {@code System.arraycopy(src, 0, dest, 0, length)}. * * @param src the source array. * @param dest the destination array. * @param length the number of array elements to be copied. * @exception IndexOutOfBoundsException if copying would cause * access of data outside array bounds. * @exception NullPointerException if either <code>src</code> or * <code>dest</code> is <code>null</code>. */ public static void copyByteArray(final byte[] src, byte[] dest, int length) { System.arraycopy(src, 0, dest, 0, length); } /** * Same as {@code copyByteArray(src, dest, src.length)}. * @param src the source array. * @param dest the destination array. * @exception IndexOutOfBoundsException if copying would cause * access of data outside array bounds. * @exception NullPointerException if either <code>src</code> or * <code>dest</code> is <code>null</code>. */ public static void copyByteArray(final byte[] src, byte[] dest) { copyByteArray(src, dest, src.length); } }