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);
  }
}

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 ) ; } }
prints a string to the stream , encoded as utf - 8 with preceeding length
