protected byte[] generateRandomBytes(int length){
  byte[] data=new byte[length];
  while (length-- != 0) {
    data[length]=(byte)(Math.random() * (122 - 65) + 65);
  }
  return data;
}

protected byte [ ] generateRandomBytes ( int length ) { byte [ ] data = new byte [ length ] ; while ( length -- != 0 ) { data [ length ] = ( byte ) ( Math . random ( ) * ( 122 - 65 ) + 65 ) ; } return data ; }
create a byte array suitable for using in message objects such as stringmessage .
