Commit 2f026b4d authored by Przemyslaw Szczepaniak's avatar Przemyslaw Szczepaniak
Browse files

Fix ByteBuffer.put(ByteBuffer) edge case.

Replaced use of ByteBuffer.array() in ByteBuffer.put(ByteBuffer)
with a raw "hb" field access. This prevents .array() throwing a
ReadOnlyBufferException in case the buffer is a MappedByteBuffer
(only type of ByteBuffer without a backing array) and the put
argument is a non-empty, read-only HeapByteBuffer.

Removed the test from this cherry-pick to not cause CTS
issues.

Test: CtsLibcoreTestCases
Bug: 34045479

_______________________________

Change-Id: I59dcfab85c4ee6bc02f1f5dad4ad2f8de43dd991
(cherry picked from commit 094c77be)
parent 2536f92f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment