@Test public void testCopy() throws Exception { assertArrayEquals(new byte[] {56, 98, 23}, ArraysUtil.copy(new byte[] {56, 98, 23})); assertArrayEquals(new byte[] {}, ArraysUtil.copy(new byte[] {})); assertArrayEquals(new byte[] {}, ArraysUtil.copy(null)); }
public static byte[] copy(byte[] source) { if (source == null) { return new byte[0]; } byte[] result = new byte[source.length]; System.arraycopy(source, 0, result, 0, source.length); return result; }
ArraysUtil { public static byte[] copy(byte[] source) { if (source == null) { return new byte[0]; } byte[] result = new byte[source.length]; System.arraycopy(source, 0, result, 0, source.length); return result; } }
ArraysUtil { public static byte[] copy(byte[] source) { if (source == null) { return new byte[0]; } byte[] result = new byte[source.length]; System.arraycopy(source, 0, result, 0, source.length); return result; } private  ArraysUtil(); }
ArraysUtil { public static byte[] copy(byte[] source) { if (source == null) { return new byte[0]; } byte[] result = new byte[source.length]; System.arraycopy(source, 0, result, 0, source.length); return result; } private  ArraysUtil(); static BitSet getBitAddress(String ip); static int bytes2int(byte[] bytes); static byte[] combine(byte[]... bytes); static byte convertBits(Boolean... bits); static byte[] copy(byte[] source); static int getBit(byte _byte, int position); static byte[] int2bytes(int value); static byte[] int2bytesCropp(int value, int nbytes2cropp); static byte[] readBytes(byte[] source, int start); static byte[] readBytes(byte[] source, int start, int length); static byte reverseBitsByte(byte x); static byte setBit(byte _byte, int position, boolean value); }
ArraysUtil { public static byte[] copy(byte[] source) { if (source == null) { return new byte[0]; } byte[] result = new byte[source.length]; System.arraycopy(source, 0, result, 0, source.length); return result; } private  ArraysUtil(); static BitSet getBitAddress(String ip); static int bytes2int(byte[] bytes); static byte[] combine(byte[]... bytes); static byte convertBits(Boolean... bits); static byte[] copy(byte[] source); static int getBit(byte _byte, int position); static byte[] int2bytes(int value); static byte[] int2bytesCropp(int value, int nbytes2cropp); static byte[] readBytes(byte[] source, int start); static byte[] readBytes(byte[] source, int start, int length); static byte reverseBitsByte(byte x); static byte setBit(byte _byte, int position, boolean value);  }