Let's say i have a list/arrayList or an array of ByteBuffers (List<ByteBuffer> or ByteBuffer[])
It is possible from this to directly get the bytes from the above array without iterating through all the items or computing their total size? I am looking for something like this:
ByteBuffer[] bufferList = new ByteBuffer[7]; //this can be any kind of list of ByteBuffers
//add items to the array
ByteBuffer buffer = (ByteBuffer) bufferList; //what i want to achieve
Of course the last line is not correct.
The thing is that i already have in the array all the bytes in order, but I want them not to be in a list anymore, but in a single ByteBuffer. So is there something that makes possible to create a ByteBuffer from a list/array of ByteBuffers?
Thank you!
ByteBufferelements in an array or list that each have X bytes and you want to add all those bytes to a singleByteBuffer?