Here you can find the source of clone(final byte[] array)
Parameter | Description |
---|---|
array | the array to be cloned |
public static byte[] clone(final byte[] array)
//package com.java2s; //License from project: Open Source License public class Main { /**/*w w w .ja v a 2 s .co m*/ * Clones an array of bytes. * * @param array the array to be cloned * @return a new array filled with the elements of the argument array */ public static byte[] clone(final byte[] array) { return clone(array, 0, array.length); } /** * Clones a segment of an array of bytes. * * @param array the array with the segment to be cloned * @param start the initial position of the segment * @param length the lenght of the segment to be cloned * @return a new byte array filled with the elements corresponding to the specified * segment */ public static byte[] clone(final byte[] array, final int start, final int length) { final byte[] result = new byte[length]; System.arraycopy(array, start, result, 0, length); return result; } }