For testing, you could change the underlying Stream to a ByteArrayOutputStream(vs getting one from the socket) that you could then examine after you send/write some data to see what is being written...