title: Java Socket, small string needlessly being split across two packets
body: <p>I was attempting to communicate to a device server with Sockets, after having my little Java program hang when on <code>readLine</code> I ended up having to inject my target application with a packet sniffer and found out that <code>os.writeBytes("notify\n");</code> was being split to two packets, the first containing <code>n</code> and the next <code>otify</code>, of which the server did not like. I fixed this by adding another <code>writeBytes</code> before hand:</p>
  
  <p><code>
  os.writeBytes(" ");<br>
  os.writeBytes("notify\n");<br>
  os.flush();
  </code></p>
  
  <p>This to me seems a bit hacky and potentially unstable, could someone shed some light why I'm having to do this and give me a better solution.</p>
  
  <p>Cheers</p>