I am having a string which needs to be sent as response from a servlet & I am having two approaches to send response back from it.
First is using PrintWriter.
Use an OutputStream for binary data, and a Writer for text.