Replacing default BUFFSIZE value with new buffer size value when a resize needs to...
authorrtrimana <rtrimana@uci.edu>
Sat, 7 Jan 2017 02:54:40 +0000 (18:54 -0800)
committerrtrimana <rtrimana@uci.edu>
Sat, 7 Jan 2017 02:54:40 +0000 (18:54 -0800)
iotjava/iotrmi/Java/IoTSocket.java

index 75855132bbc9a988d69515da21cf65970278c7e7..5e1d35e70a999705085a1d69ef198acd0e400547 100644 (file)
@@ -90,7 +90,8 @@ public abstract class IoTSocket {
                        while (newLen < maxlen) // Shift until we get a new buffer size that's bigger than maxLen (basically power of 2)
                                newLen = newLen << 1;
                        System.out.println("IoTSocketClient/Server: Allocating a bigger buffer now with size: " + newLen);
                        while (newLen < maxlen) // Shift until we get a new buffer size that's bigger than maxLen (basically power of 2)
                                newLen = newLen << 1;
                        System.out.println("IoTSocketClient/Server: Allocating a bigger buffer now with size: " + newLen);
-                       data = new byte[newLen];
+                       BUFFSIZE = newLen;
+                       data = new byte[BUFFSIZE];
                }
                val = new byte[maxlen];
                while (totalbytes < maxlen)
                }
                val = new byte[maxlen];
                while (totalbytes < maxlen)