Hi there!
I'm working on a bit of software to visualize packets from a .pcap file in a TableView, very similar to Wireshark (columns for source ip, destination ip, protocol, etc.).
Try 1:
At first I used this tutorial: http://code.makery.ch/library/javafx-8-tutorial/part1/
That way I simply loaded all data into an Observable List and bound it to the TableView. But as I work with 100mb+ pcap files, that ate a lot of RAM (~1.25gb), so I scrapped it.
Try 2:
Then I scanned the pcap file for the starting bytes of each packet using mappedbytebuffers. So I have an arrayList containing these start bytes of each packet. Then I adjusted the Property getters to instead navigate to that byte and decode from there. So instead of simply reading the string from an object, it reads from the file, meaning the actual observablelist contains just a bunch of objects that contain nothing more than a number, which I use to identify the packet. This worked nicely for visualizing the data and used very litte ram, but filtering doesn't work anymore. As described in the guide, I wrap the observablelist in a filteredlist which is then wrapped in a sortedlist. When i type something into the textarea I use for filtering, the app freezes and usually crashes after a few minutes, sometimes taking eclipse with it. Note that that only happens with a lot of rows in the tableview.
Try 3:
Similar to Try 2, I made custom cellfactories for each column which call the decoding methods. I'm still trying things here, but right now the tableview stays completely empty.
What do you think is the best approach for what I am trying to do? If you want to see specific parts of my code or need further explanation, do tell me. I wasn't sure what part of the code to post as it's a lot.
Thank you!
Message was edited by: e7a881fb-9a9a-48b1-849e-c045412edb47 reason: typo