public static DataPacket getTemplate(int packetSize) { int emptyPackSize = new FSTStructAllocator(1).newStruct(new DataPacket()).getByteSize(); DataPacket template = new DataPacket(); int payMaxLen = packetSize - emptyPackSize - 2; template.data = new byte[payMaxLen]; return template; }
public static DataPacket getTemplate(int packetSize) { int emptyPackSize = new FSTStructAllocator(1).newStruct(new DataPacket()).getByteSize(); DataPacket template = new DataPacket(); int payMaxLen = packetSize - emptyPackSize - 2; template.data = new byte[payMaxLen]; return template; }
template.setTopic(topic); offheapAllocator = new FSTStructAllocator(0, new MallocBytezAllocator()); heapAllocator = new FSTStructAllocator(0);
template.setTopic(topic); offheapAllocator = new FSTStructAllocator(0, new MallocBytezAllocator()); heapAllocator = new FSTStructAllocator(0);
retransTemplate.setSeqNo(-1); packetAllocator = new FSTStructAllocator(10, new MallocBytezAllocator()); readBuffer = packetAllocator.newArray(historySize,template); this.nodeId = packetAllocator.newStruct( new StructString(Packet.MAX_NODE_NAME_LEN) );
retransTemplate.setSeqNo(-1); packetAllocator = new FSTStructAllocator(10, new MallocBytezAllocator()); readBuffer = packetAllocator.newArray(historySize,template); this.nodeId = packetAllocator.newStruct( new StructString(Packet.MAX_NODE_NAME_LEN) );