commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject commons-crypto git commit: CRYPTO-125: CryptoOutputStream does not call write in a loop when underlying channel works in non-block mode. (Reviewed by Sun, Dapeng and Ke, Xianda)
Date Mon, 24 Oct 2016 02:30:16 GMT
Repository: commons-crypto
Updated Branches:
  refs/heads/master 77af2da3d -> 3adc20723


CRYPTO-125: CryptoOutputStream does not call write in a loop when underlying channel works
in non-block mode. (Reviewed by Sun, Dapeng and Ke, Xianda)

Closes #71 from cjjnjust:master


Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/3adc2072
Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/3adc2072
Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/3adc2072

Branch: refs/heads/master
Commit: 3adc20723b823bad58a39f7952300538450d3b7c
Parents: 77af2da
Author: Junjie Chen <junjie.j.chen@intel.com>
Authored: Mon Oct 24 10:11:29 2016 +0800
Committer: Sun Dapeng <sdp@apache.org>
Committed: Mon Oct 24 10:12:29 2016 +0800

----------------------------------------------------------------------
 .../org/apache/commons/crypto/stream/CryptoOutputStream.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/3adc2072/src/main/java/org/apache/commons/crypto/stream/CryptoOutputStream.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/stream/CryptoOutputStream.java b/src/main/java/org/apache/commons/crypto/stream/CryptoOutputStream.java
index efa1f95..bb59e2f 100644
--- a/src/main/java/org/apache/commons/crypto/stream/CryptoOutputStream.java
+++ b/src/main/java/org/apache/commons/crypto/stream/CryptoOutputStream.java
@@ -360,7 +360,9 @@ public class CryptoOutputStream extends OutputStream implements
         outBuffer.flip();
 
         // write to output
-        output.write(outBuffer);
+        while (outBuffer.hasRemaining()) {
+            output.write(outBuffer);
+        }
     }
 
     /**
@@ -386,7 +388,9 @@ public class CryptoOutputStream extends OutputStream implements
         outBuffer.flip();
 
         // write to output
-        output.write(outBuffer);
+        while (outBuffer.hasRemaining()) {
+            output.write(outBuffer);
+        }
     }
 
     /**


Mime
View raw message