public PacketOutputStream writeString(final String str){
  final byte[] strBytes;
  try {
    strBytes=str.getBytes("UTF-8");
    return writeByteArray(strBytes);
  }
 catch (  UnsupportedEncodingException u) {
    return this;
  }
}

public PacketOutputStream writeString ( final String str ) { final byte [ ] strBytes ; try { strBytes = str . getBytes ( "UTF-8" ) ; return writeByteArray ( strBytes ) ; } catch ( UnsupportedEncodingException u ) { return this ; } }
write string data in binary format .
