Here you can find the source of copy(byte[] bytes)
Parameter | Description |
---|---|
bytes | The byte array. |
static public byte[] copy(byte[] bytes)
//package com.java2s; /************************************************************************ * Copyright (c) Crater Dog Technologies(TM). All Rights Reserved. * ************************************************************************ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * * * This code is free software; you can redistribute it and/or modify it * * under the terms of The MIT License (MIT), as published by the Open * * Source Initiative. (See http://opensource.org/licenses/MIT) * ************************************************************************/ import java.util.Arrays; public class Main { /**/*from www . j a v a 2s .c o m*/ * This function creates a copy of a byte array. * * @param bytes The byte array. * @return A copy of the byte array. */ static public byte[] copy(byte[] bytes) { byte[] result = Arrays.copyOf(bytes, bytes.length); return result; } }