Here you can find the source of clone(byte[] input)
Parameter | Description |
---|---|
input | the byte array to clone |
public static byte[] clone(byte[] input)
//package com.java2s; /******************************************************************************* * Copyright (c) 2017 JCrypTool Team and Contributors * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html *******************************************************************************/ public class Main { /**/* w w w .j a va 2 s .c om*/ * Clone a byte array. * * @param input the byte array to clone * @return new byte array, or null if input is null */ public static byte[] clone(byte[] input) { if (input == null) { return null; } byte[] ret = new byte[input.length]; System.arraycopy(input, 0, ret, 0, input.length); return ret; } }