Have ByteBuffer.wrap() use the appropriate subarray
This puts ByteBuffer.wrap() and ByteBuffer#position() on one line.
Test: atest ApfIntegrationTest
Change-Id: I33d138edd91e1c39625fe91c69e91c4296582d7d
diff --git a/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt b/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt
index a93e954..3b7ff83 100644
--- a/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt
+++ b/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt
@@ -458,8 +458,7 @@
packetReader.expectPingReply()
val readResult = readProgram()
- val buffer = ByteBuffer.wrap(readResult)
- buffer.position(counterRegion)
+ val buffer = ByteBuffer.wrap(readResult, counterRegion, 20 /* length */)
expect.withMessage("PROGRAM_SIZE").that(buffer.getInt()).isEqualTo(program.size)
expect.withMessage("RAM_LEN").that(buffer.getInt()).isEqualTo(caps.maximumApfProgramSize)
expect.withMessage("IPV4_HEADER_SIZE").that(buffer.getInt()).isEqualTo(0)