I have written an application that transfers data across a network using Socket, getInputStream(), getOutputStream(). I have some concerns about how to optimize for performance.
Currently I am writing one byte at a time to the OutputStream. I am wondering if this results in a separate TCP packet being sent for each byte, which would obviously be very inefficient. Or does it buffer the data into a packet before sending?
If I need to wrap my OutputStream, what is the recommended way to do it?