Skip to content

Commit 37de15f

Browse files
committed
Drop RandomAccessBody.transferTo position parameter, close AsyncHttpClient#1021
1 parent aa4078a commit 37de15f

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

client/src/main/java/org/asynchttpclient/netty/request/body/BodyFileRegion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public long transfered() {
5454

5555
@Override
5656
public long transferTo(WritableByteChannel target, long position) throws IOException {
57-
long written = body.transferTo(position, target);
57+
long written = body.transferTo(target);
5858
if (written > 0) {
5959
transfered += written;
6060
}

client/src/main/java/org/asynchttpclient/request/body/RandomAccessBody.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,11 @@ public interface RandomAccessBody extends Body {
2424
/**
2525
* Transfers the specified chunk of bytes from this body to the specified channel.
2626
*
27-
* @param position
28-
* The zero-based byte index from which to start the transfer, must not be negative.
2927
* @param target
3028
* The destination channel to transfer the body chunk to, must not be {@code null}.
3129
* @return The non-negative number of bytes actually transferred.
3230
* @throws IOException
3331
* If the body chunk could not be transferred.
3432
*/
35-
long transferTo(long position, WritableByteChannel target) throws IOException;
33+
long transferTo(WritableByteChannel target) throws IOException;
3634
}

client/src/main/java/org/asynchttpclient/request/body/multipart/MultipartBody.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ public BodyState transferTo(ByteBuffer target) throws IOException {
102102
}
103103

104104
// RandomAccessBody API, suited for HTTP but not for HTTPS (zero-copy)
105-
public long transferTo(long position, WritableByteChannel target) throws IOException {
105+
@Override
106+
public long transferTo(WritableByteChannel target) throws IOException {
106107

107108
if (done)
108109
return -1L;

0 commit comments

Comments
 (0)