ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject incubator-ignite git commit: IGNITE-61 - Direct marshalling
Date Fri, 06 Feb 2015 03:25:17 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-61 888e8ed2a -> 9c0255bea


IGNITE-61 - Direct marshalling


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9c0255be
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9c0255be
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9c0255be

Branch: refs/heads/ignite-61
Commit: 9c0255beac1a2fe1787c0c3ba8ab38e6af471b3b
Parents: 888e8ed
Author: Valentin Kulichenko <vkulichenko@gridgain.com>
Authored: Thu Feb 5 19:25:09 2015 -0800
Committer: Valentin Kulichenko <vkulichenko@gridgain.com>
Committed: Thu Feb 5 19:25:09 2015 -0800

----------------------------------------------------------------------
 .../util/direct/GridTcpCommunicationByteBufferStream.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9c0255be/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationByteBufferStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationByteBufferStream.java
b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationByteBufferStream.java
index 379cc46..0ffefb4 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationByteBufferStream.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationByteBufferStream.java
@@ -205,7 +205,7 @@ public class GridTcpCommunicationByteBufferStream {
     private long baseOff;
 
     /** */
-    private int arrOff;
+    private int arrOff = -1;
 
     /** */
     private Object tmpArr;
@@ -572,11 +572,13 @@ public class GridTcpCommunicationByteBufferStream {
         assert bytes >= 0;
         assert bytes >= arrOff;
 
-        if (arrOff == 0) {
+        if (arrOff == -1) {
             if (remaining() < 4)
                 return false;
 
             writeInt(len);
+
+            arrOff = 0;
         }
 
         int toWrite = bytes - arrOff;
@@ -590,7 +592,7 @@ public class GridTcpCommunicationByteBufferStream {
 
             buf.position(pos);
 
-            arrOff = 0;
+            arrOff = -1;
 
             return true;
         }
@@ -623,7 +625,7 @@ public class GridTcpCommunicationByteBufferStream {
                 return null;
             }
 
-           int len = readInt();
+            int len = readInt();
 
             switch (len) {
                 case -1:


Mime
View raw message