[Cronet] Add read() replacement that modifies ByteBuffer position() not limit()
commit7dd31c596f6e6277a263beb9268ef92238e30a85
authorpauljensen <pauljensen@chromium.org>
Tue, 15 Sep 2015 11:15:37 +0000 (15 04:15 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 15 Sep 2015 11:16:23 +0000 (15 11:16 +0000)
treef5aad46722ac7650b547ed0c0080c7df03913919
parentffae9cde39b5569caa4c7939a0818f7aa3ec471b
[Cronet] Add read() replacement that modifies ByteBuffer position() not limit()

This is more in line with other Java APIs (e.g. ReadableByteChannel.read).
Replacing read() directly would be break API compatibility, so this CL adds
a new API, readNew(), to transition embedders to until read() is removed and
readNew() is renamed read() in later CLs. Also included in this CL are some
non-functional changes to use ByteBuffer limit() rather than capacity() when
appropriate.

BUG=531538

Review URL: https://codereview.chromium.org/1322203004

Cr-Commit-Position: refs/heads/master@{#348868}
components/cronet/android/java/src/org/chromium/net/CronetUrlRequest.java
components/cronet/android/java/src/org/chromium/net/UrlRequest.java
components/cronet/android/java/src/org/chromium/net/UrlRequestListener.java
components/cronet/android/java/src/org/chromium/net/urlconnection/CronetBufferedOutputStream.java
components/cronet/android/java/src/org/chromium/net/urlconnection/CronetChunkedOutputStream.java
components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java
components/cronet/android/java/src/org/chromium/net/urlconnection/CronetHttpURLConnection.java
components/cronet/android/java/src/org/chromium/net/urlconnection/CronetInputStream.java
components/cronet/android/test/javaperftests/src/org/chromium/net/CronetPerfTestActivity.java
components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestTest.java
components/cronet/android/test/javatests/src/org/chromium/net/TestUrlRequestListener.java