code: public void printLenString(String v)
          throws IOException
      {
          if (v == null) {
              os.write(0);
              os.write(0);
          }
          else {
              int len = v.length();
              os.write(len >> 8);
              os.write(len);
  
              printString(v, 0, len);
          }
      }
docs: Prints a string to the stream, encoded as UTF-8 with preceeding length
  
  @param v the string to print.