Here you can find the source of copyArrayWhenNotNull(byte[] source)
Parameter | Description |
---|---|
source | a parameter |
final public static byte[] copyArrayWhenNotNull(byte[] source)
//package com.java2s; //License from project: Apache License import java.util.Arrays; public class Main { /**//from w w w . ja va 2 s .c o m * Copies array or returns null when source is null. * @param source * @return copied array */ final public static byte[] copyArrayWhenNotNull(byte[] source) { if (source != null) { return Arrays.copyOf(source, source.length); } else { return null; } } }