You can't use a Writer for binary data. Writers are to Streams as Strings are to byte arrays. You need to use byte arrays for binary data; if you Strings, you can be guaranteed that your code will work inconsistently in different environments.
Even if you use a Stream, Print* is still inappropriate for sockets (but not because it won't work). You should use a packet buffer to construct your packets and convert them to a byte[], and then write() that directly to the socket's OutputStream, thus making the write operation atomic, fault-resistant, and thread-safe.