title: How could I sniff network traffic in Java?
body: <p>I was just looking around to find out how to make a program that would sniff my network traffic in Java, but I couldn't find anything. I wanted to know if there was any way to view the network traffic going by. I heard of an idea with a <a href="http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html" rel="noreferrer">Socket</a>, but I don't get how that would work. So anyways, just looking for an API or a way to write it myself.</p>
  
  <p><strong>EDIT:</strong>
  I would gladly like an API, but I would also like clarification on the way to sniff traffic with a Socket.</p>