title: DataOutputStream: purpose of the "encoded string too long" restriction
body: <p>There is a strange restriction in <code>java.io.DataOutputStream.writeUTF(String str)</code> method, which limits the size of an UTF-8 encoded string to <code>65535</code> bytes:</p>
  <pre><code>    if (utflen &gt; 65535)
          throw new UTFDataFormatException(
              &quot;encoded string too long: &quot; + utflen + &quot; bytes&quot;);
  </code></pre>
  <p>It is strange, because:</p>
  <ol>
  <li>there is no any information about this restriction in JavaDoc of this method</li>
  <li>this restriction can be easily solved by copying and modifying an internal <code>static int writeUTF(String str, DataOutput out) </code> method of this class</li>
  <li>there is no such restriction in the opposite method <code>java.io.DataInputStream.readUTF()</code>.</li>
  </ol>
  <p>According to the said above I can not understand the purpose of a such restriction in the <code>writeUTF</code> method. What have I missed or misunderstood?</p>