Verify java.nio.ByteBuffer against OpenJDK8u121-b13, part 3.

This completes verification of ByteBuffer. After this CL, all
remaining Android changes carry appropriate change markers.

1. Document addition of ByteBuffer.{get,put}*Unchecked() and make
   these methods abstract.

These methods are implemented in DirectByteBuffer and HeapByteBuffer.
There is no need for the abstract base class to carry an implemetation
that throws UnsupportedOperationException.

It would be possible to move these methods out into a separate interface
(implemented by DirectByteBuffer or another utility class instace passed
separately into the *BufferAs*Buffer constructors) to keep these changes
out of ByteBuffer.java. It's not clear whether this is worth the effort
overall, so this CL does not do that.

2. Document addition of boolean isAccessible(), void setAccessible(boolean).

It would have been possible to have these methods only on
DirectByteBuffer; callers of setAccessible() would have needed to use
the compile-time type DirectByteBuffer where they currently use ByteBuffer
and rely on the fact that that method won't throw only at runtime. The
size of this refactoring in MediaCodec (and perhaps elsewhere) didn't
seem worth it, so this CL does not pursue that option.

Test: CtsLibcoreTestCases
Bug: 35910877

Change-Id: I507e2ce605fb52ab915fd26b48aa34bbaca1fb45
1 file changed