I want to read bytes from httpresponse coming from server continuosly into an array.
I’m creating a byte array with a maximum size of 2048.
So, I wanted to create a dynamically increasing array and I found that ArrayList is the solution.
How can i overcome this solution?
Any help would be appreciated lot
You can have an array of byte like:
List<Byte> arrays = new ArrayList<Byte>();To convert it back to arrays
Byte[] soundBytes = arrays.toArray(new Byte[arrays.size()]);– You can also use
ByteArrayInputStreamandByteArrayOutputStream.Eg: