docs: public void writeUTF(String pString) throws IOException {
          int numchars = pString.length();
          int numbytes = 0;
  
          for (int i = 0; i < numchars; i++) {
              int c = pString.charAt(i);
  
              if ((c >= 0x0001) && (c <= 0x007F)) {
                  numbytes++;
              }
              else if (c > 0x07FF) {
                  numbytes += 3;
              }
              else {
                  numbytes += 2;
              }
          }
  
          if (numbytes > 65535) {
              throw new UTFDataFormatException();
          }
  
          file.write((numbytes >>> 8) & 0xFF);
          file.write(numbytes & 0xFF);
  
          for (int i = 0; i < numchars; i++) {
              int c = pString.charAt(i);
  
              if ((c >= 0x0001) && (c <= 0x007F)) {
                  file.write(c);
              }
              else if (c > 0x07FF) {
                  file.write(0xE0 | ((c >> 12) & 0x0F));
                  file.write(0x80 | ((c >> 6) & 0x3F));
                  file.write(0x80 | (c & 0x3F));
              }
              else {
                  file.write(0xC0 | ((c >> 6) & 0x1F));
                  file.write(0x80 | (c & 0x3F));
              }
          }
      }