title: Java limit at json format
body: <p>I want to transfer some database data through a TCP socket. The data is formatted to JSON.</p>
  
  <p>Since the database size might grow, I'm afraid that the String object maximum size will not be enough to store the entire data with JSON formatting.</p>
  
  <p>I already had an problem transferring the data using the DataOutput function <code>writeUTF()</code>.</p>
  
  <p>What should I do? Maybe convert the database rows to CSV and transfer it through the Internet line by line? Or do I not need to worry about String limits and solve the <code>writeUTF()</code> problem by getting the bytes of the String, transferring them through the socket and rebuilding the String from the bytes at the destination?</p>