title: Hooking Java sockets to monitor socket in library code I can't modify
body: <p>I'm using a Java library that uses a socket to communicate with the world.  I'd like to get a reference to that socket so I can monitor the data the library is sending and receiving.  Is there any way to hook Java's sockets system so I can monitor socket communications when I can't modify the code that creates the socket?</p>