I am building a simple client/server application using java sockets and experimenting with the ObjectOutputStream etc.
I have been following the tutorial at this url
It's better to open an outputStream because an output stream doesn't block. Then, you have the input stream that waits for a Stream. After all the streams, you write to the stream and flush it - outputStream.flush() to send the bytes of data. You'll also need a method on the other end to read the input, whether it's simply inputStream.read() which reads every byte as an integer for a char, or by using a BufferedReader or Scanner. I've used almost all methods possible, but the most effective method for sending is outputStream.write(String) which writes a sequence of chars as bytes into the stream and reading inputStream.read() reads a single char. I hope this helps.