From: rtrimana Date: Sat, 7 Jan 2017 02:54:40 +0000 (-0800) Subject: Replacing default BUFFSIZE value with new buffer size value when a resize needs to... X-Git-Url: http://plrg.eecs.uci.edu/git/?p=iot2.git;a=commitdiff_plain;h=d4497d263bb670a1256868873081bd1a792f07d5 Replacing default BUFFSIZE value with new buffer size value when a resize needs to happen --- diff --git a/iotjava/iotrmi/Java/IoTSocket.java b/iotjava/iotrmi/Java/IoTSocket.java index 7585513..5e1d35e 100644 --- a/iotjava/iotrmi/Java/IoTSocket.java +++ b/iotjava/iotrmi/Java/IoTSocket.java @@ -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)