An ObjectOutputStream writes primitive data types and graphs of Java objects to an OutputStream. The objects can be read (reconstituted) using an ObjectInputStream. Persistent storage of objects can be accomplished by using a file for the stream. If the stream is a network socket stream, the objects can be reconstituted on another host or in another process.
A data output stream lets an application write primitive Java data types to an output stream in a portable way. An application can then use a data input stream to read the data back in." You don't need to write primitive data types in binary, so do not use DataOutputStream
An OutputStreamWriter is a bridge from character streams to byte streams: Characters written to it are encoded into bytes using a specified charset. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted.
You need to create an OutputStreamWriter for sending json objects to the client
OutputStreamWriter out = new OutputStreamWriter(socket.getOutputStream());
JSONObject obj = new JSONObject();
obj.put("name", "harris");
obj.put("age", 23);
out.write(obj.toString());
You can read the output data from the client using InputStreamReader by this way
InputStreamReader input = new InputStreamReader(socket.getInputStream());
int data = input.read();
while (data != -1) {
System.out.print((char)data);
data = input.read();
}