public static void writeStringASCII(ByteBuf stream,String str) throws UnsupportedEncodingException {
  final byte[] bytes=str.getBytes("US-ASCII");
  stream.writeInt(str.length());
  stream.writeBytes(bytes);
}

public static void writeStringASCII ( ByteBuf stream , String str ) throws UnsupportedEncodingException { final byte [ ] bytes = str . getBytes ( "US-ASCII" ) ; stream . writeInt ( str . length ( ) ) ; stream . writeBytes ( bytes ) ; }
writes an ascii string to the stream , the first value will be an integer for the length of the string , followed by bytes
