I have a ByteBuffer that allocates memory from a Direct Buffer, and now there is some data in it that I want to pass across processes, so I will parcel the data in it as a ByteArray.
However, if I read the data out of it to create a new temporary ByteArray, there is obviously one more copying operation.
If I want to avoid this copy, I can just write the data directly to the parcel as if ByteBuffer.hasArray()
is true.
Is it possible?