There are no examples, because AFAIK, core
Java doesn't provide an API that will help you implement packet sniffers. I think the original creators of Java wanted to stay away for allowing people to implement hacking programs in Java. You can implement a eavesdropper using languages like C++ that let you call the OS directly. There are libraries available that are implemented in C++ and can be called from JNI. It's not hard to find something that you can use to implement a packet sniffer in Java.
At the wire level, the way data is passed around on the internet is more or less very similar to how kids pass notes in class. One kid writes a note, folds it and passes it to his/her neighbor. That kid passes it to the next and so on until it reaches the destination. Kids rely on a code of honor that says that you will not peek. However, there is nothing secure about the note. Within a LAN , the communication is very similar to how people communicate in a family gatherings:- Ideally, everyone sits around the table and people take turns talking. Everyone can hear what the talker is saying. They just ignore what is being said if they are not interested.