I have ArrayList of bytes.I want to use System.arraycopy function for combile all bytes of the ArrayList.Following is my code.
public void createFile(ArrayList<byte[]> arrayList) throws IOException
{
FileOutputStream fos = new FileOutputStream(Constant.MERGE_DIRECOTRY + "out" + Constant.FILE_EXTENSION.toString());
for(byte[] data: arrayList)
fos.write(data);
fos.close();
MediaPlayer mp = MediaPlayer.create(MergerActivity.this, Uri.parse(Constant.MERGE_DIRECOTRY + "out" + Constant.FILE_EXTENSION.toString()));
if(mp != null)
{
totalduration = totalduration + mp.getDuration();
Log.d("duration",""+Utilis.milliSecondsToTimer(totalduration));
}
}
How can i use System.arraycopy function instead if fos.write().