This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Notice that you are using an OutputStreamWriter. Does it make sense to read from an output socket? I think you need an InputStream or a Reader (perhaps even an InputStreamReader) to do what you want. I have a feeling that you need to learn more about the fundamentals of I/O in Java. You should work through the I/O Trail from Sun's Java tutorial (see the link in my signature for the full tutorial) in order to get a better grasp on I/O basics. Once you understand the basic functionality of the I/O API, you will find the Java API documentation (again, see the link in my signature) to look up specific classes and methods.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi