java代码转delphi(50)

  • 主题发起人 主题发起人 zylsoft
  • 开始时间 开始时间
Z

zylsoft

Unregistered / Unconfirmed
GUEST, unregistred user!
static protected void str2byte(byte[] ba, String s, int start, int len) { if (ba.length <= start + len - 1) return; if (s.length() < len) { for(int i = 0; i < s.length(); i++) { ba[start + i] = (byte)s.charAt(i); } for(int i = s.length(); i < len; i++) { ba[start + i] = 0; } } else { for(int i = 0; i < len; i++) { ba[start + i] = (byte)s.charAt(i); } } } 谁能帮转下!!
 
Type ByteArr=array of byte;procedure Str2byte( ba:ByteArr; S:String; start:Integer; len:Integer);var i:Integer;begin if Length(ba) <= (start + len - 1) then exit; if Length(s) < len then begin for i:=0 to Length(S)-1 do ba[start + i] := Ord(S[i+1]) for i:=Length(S) to Len-1 Do ba[start + i] = 0; End else begin for I:=0 to Len-1 do ba[start + i] = Ord(S[i+1]); end;end;
 
后退
顶部