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 7585513..5e1d35e 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);
-                       data = new byte[newLen];
+                       BUFFSIZE = newLen;
+                       data = new byte[BUFFSIZE];
                }
                val = new byte[maxlen];
                while (totalbytes < maxlen)