You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2019/01/02 16:51:23 UTC

[maven-wagon] 02/02: Read at most possible bytes into the buffer

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch no-channels
in repository https://gitbox.apache.org/repos/asf/maven-wagon.git

commit 679f2958c26f460a44932d4de5a196373ba5e225
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Wed Jan 2 17:50:32 2019 +0100

    Read at most possible bytes into the buffer
---
 .../src/main/java/org/apache/maven/wagon/AbstractWagon.java            | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java b/wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java
index 4cbf37d..7689c86 100644
--- a/wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java
+++ b/wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java
@@ -568,8 +568,7 @@ public abstract class AbstractWagon
         long remaining = maxSize;
         while ( remaining > 0 )
         {
-            // let's safely cast to int because the min value will be lower than the buffer size.
-            int n = input.read( buffer, 0, (int) Math.min( buffer.length, remaining ) );
+            int n = input.read( buffer, 0, buffer.length );
 
             if ( n == -1 )
             {