public static byte[] getbytes( String s ) { int len = s.Length; byte[] r = new byte[len]; for ( int i= 0 ; i < len ; ++i ) r[i]= (byte)s[i]; return r; }