I am trying to add int values to an int[] as follows.
private ArrayList<int []> read_studioConfig(byte[] buf, int boundary, int offset, int num){
ArrayList<int []> configs_values = new ArrayList<int[]>();
int readValues = 0;
int idx = offset;
for (int i = 0 ;i < num; i++){
while(idx < boundary && buf[idx] != 0){
readValues = i;
idx ++;
}
idx ++;
configs_values.add(readValues);
}
return configs_values;
};
But I could not able to do it. I am getting the following error.
error: no suitable method found for add(int) method Collection.add(int[]) is not applicable (argument mismatch; int cannot be converted to int[]) method List.add(int[]) is not applicable (argument mismatch; int cannot be converted to int[])**
I am doing a stupid mistake but can't put finger on it. What am I missing here ?
intarrays.arraylist of intarraysArrayList<ArrayList<Integer>> arr = new ArrayList<ArrayList<Integer>>();ints.