The list of methods to do Byte Array Copy are organized into topic(s).
byte[]
copyByteArray(byte[] array2Copy) copy Byte Array
if (array2Copy == null) {
throw new IllegalArgumentException("Argument 'array2Copy' cannot be null");
return copyByteArray(array2Copy, 0, array2Copy.length);
byte[]
copyByteArray(byte[] source) copy Byte Array
byte[] buf = new byte[source.length];
System.arraycopy(source, 0, buf, 0, buf.length);
return buf;
void
copyByteArray(final byte[] src, byte[] dest, int length) Same as System.arraycopy(src, 0, dest, 0, length) .
System.arraycopy(src, 0, dest, 0, length);
byte[]
copyBytes(byte[] arr, int length) copy Bytes
byte[] newArr = null;
if (arr == null || arr.length == length) {
newArr = arr;
} else {
newArr = new byte[length];
for (int i = 0; i < length; i++) {
newArr[i] = (byte) arr[i];
return newArr;
byte[]
copyBytes(byte[] from, byte[] to, int fromIndex) Copy bytes completely from a source byte array to a destination byte array starting at the destination index
int counter = 0;
for (byte b : from) {
to[fromIndex + counter] = b;
++counter;
return to;
void
copyBytes(byte[] results, int offset, int int32) copy Bytes
byte[] src = new byte[4];
src[0] = (byte) (int32 & 0xff);
src[1] = (byte) ((int32 >> 8) & 0xff);
src[2] = (byte) ((int32 >> 16) & 0xff);
src[3] = (byte) ((int32 >> 24) & 0xff);
copyBytes(results, offset, src, 4, 0);