title: How to safely separate packet data?
body: <p>I am creating a multiplayer game and not sure how should I separate packet data.</p>
  
  <p>My packet structure looks like this (it is one string): id (separator) content</p>
  
  <p>And the content sometimes also has multiple separators (to send more data in one packet)</p>
  
  <p>But if my game had a chat (or any other user input), user could type the separator string and break the server. How can I prevent that?</p>
  
  <p>Is there any other more safe way of sending network data than PrintWriter to the socket output stream?</p>