allocating string problem also been removed after fixing the mistake
String data = new String();
+ Packet fragmentPtr = null;
it.reset(fragmentListPtr);
while(it.hasNext(fragmentListPtr)) {
- Packet fragmentPtr = (Packet)it.next(fragmentListPtr);
-
- data = (new String(fragmentPtr.data));
+ fragmentPtr = (Packet)it.next(fragmentListPtr);
+ data +=(fragmentPtr.data);
}
Decoded decodedPtr = new Decoded();
bytes.fragmentId = p;
bytes.numFragment = numPacket;
bytes.length = str.length();
-
endIndex = numByte -1;
- String tmpstr = str.subString(beginIndex, endIndex);
- bytes.data = new String(str);
+ String tmpstr = str.subString(beginIndex);
+ bytes.data = new String(tmpstr);
status = packetQueuePtr.queue_push(bytes);
if (status == false) {
System.out.printString("Error: Queue push failed\n");