code: public static final void writeUTF(DataOutput out,
                                        char[] chars, int offset, int length)
          throws IOException
      {
          for (int i=0; i<length; i++) {
              int c = chars[i + offset];
              if ((c >= 0x0001) && (c <= 0x007F)) {
                  out.writeByte(c);
              }
              else if (c > 0x07FF) {
                  out.writeByte(0xe0 | ((c >> 12) & 0x0f));
                  out.writeByte(0x80 | ((c >> 6) & 0x3f));
                  out.writeByte(0x80 | (c & 0x3f));
              }
              else {
                  out.writeByte(0xc0 | ((c >> 6) & 0x1f));
                  out.writeByte(0x80 | (c & 0x3f));
              }
          }
      }
docs: Writes UTF-8 encoded characters to the given stream, but does not write
  the length.