I am newbie in android. I want to resize a byte array in function. Is it possible or not. If any problem please suggest a solution to do it.
public void myfunction(){
byte[] bytes = new byte[1024];
....................
.... do some operations........
................................
byte[] bytes = new byte[2024];
}
You can do it like this:
But your old content will be discarded.If you need the old data as well, then need to create a new byte array with a diff size and call
System.arrayCopy()method to copy data from old to new.