code: public static void writeString(DataOutput out, String s) throws IOException {
          if (s != null) {
              byte[] buffer = s.getBytes("UTF-8");
              int len = buffer.length;
              out.writeInt(len);
              out.write(buffer, 0, len);
          } else {
              out.writeInt(-1);
          }
      }
docs: /*
  
  Write a String as a Network Int n, followed by n Bytes
  Alternative to 16 bit read/writeUTF.
  Encoding standard is... ?