Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { private static final byte[] NAL_START_CODE = { 0, 0, 0, 1 }; public static byte[] buildNalUnit(byte[] paramArrayOfByte, int paramInt1, int paramInt2) { byte[] arrayOfByte = new byte[NAL_START_CODE.length + paramInt2]; System.arraycopy(NAL_START_CODE, 0, arrayOfByte, 0, NAL_START_CODE.length); System.arraycopy(paramArrayOfByte, paramInt1, arrayOfByte, NAL_START_CODE.length, paramInt2); return arrayOfByte; } }