摘要: functionHexStrToStream(AHexStr:String;AStream:TStream):Boolean;variLen:Integer;Buff:String;P1,P2:PChar;B:Byte;beginResult:=False;ifNotAssigned(AStream)thenExit;iLen:=Length(AHexStr);ifiLen=0thenExit;if(iLenmod2)<>0thenExit;SetString(Buff,Nil,iLendiv2);P1:=PChar(AHexStr);P2:=PChar(Buff);whileiL 阅读全文
posted @ 2013-04-27 17:05 delphi中间件 阅读(560) 评论(0) 推荐(0) 编辑
摘要: functionStreamToHexStr(AStream:TStream):String;constHexChars:array[0..15]ofChar='0123456789ABCDEF';vari,len:Integer;beginlen:=AStream.Size-AStream.Position;SetLength(Result,len*2);AStream.Read(Pointer(Result)^,len);fori:=lendownto1dobeginResult[i*2]:=HexChars[Byte(Result[i])and$0F];Result[i* 阅读全文
posted @ 2013-04-27 17:04 delphi中间件 阅读(567) 评论(0) 推荐(0) 编辑