Here you can find the source of copyBytesAtOffset(byte[] dst, byte[] src, int offset)
Parameter | Description |
---|---|
dst | Destination. |
src | Source. |
offset | Destination offset. |
public static void copyBytesAtOffset(byte[] dst, byte[] src, int offset)
//package com.java2s; public class Main { /**/* w w w . jav a 2 s. c o m*/ * Copy src byte array to dst byte array at offset. * * @param dst Destination. * @param src Source. * @param offset Destination offset. */ public static void copyBytesAtOffset(byte[] dst, byte[] src, int offset) { if (dst == null) { throw new NullPointerException("dst == null"); } if (src == null) { throw new NullPointerException("src == null"); } if (offset < 0) { throw new IllegalArgumentException("offset hast to be >= 0"); } if ((src.length + offset) > dst.length) { throw new IllegalArgumentException("src length + offset must not be greater than size of destination"); } for (int i = 0; i < src.length; i++) { dst[offset + i] = src[i]; } } }