/ ** * Convert a string to the length array of LEN length, not enough to fix / 0 * @Param astr string * @Param Len Byte array length * @return byte array * / public static Byte [] stringtes (String " Astr, int LEN) {IF (Strutil.isempty (astr)) astr = ""; if (astr.Length ()> LEN) throw new indexoutofboundsexception ("Astr Len:" astr.length () ">" Len;
Byte result [] = new byte [len]; system.Arraycopy (astr.getbytes (), 0, result, 0, astr.getbytes (). Length); Return Result;}