function DispToStr(Value: PChar; Len: Integer): string;
var
i: integer;
Str: string;
S, D: PByte;
B, C: Byte;
begin
Result := ;
if (Value = nil) or (Len <= 0) then
Exit;
SetLength(Str, Len);
S := PByte(Str);
Move(Value^, S^, Len);
for i := 1 to Len do
begin
if (S^ >= 48) and (S^ <= 57) then
S^ := S^ - 48
else
S^ := S^ - 55;
Inc(S);
end; //for
S := PByte(Str);
SetLength(Result, Len * 5 div 8);
D := PByte(PChar(Result));
B := 0;
while Len > 0 do
begin
C := (S^ shl (B + 3)) and $FF;
Inc(S);
Dec(Len);
if B >= 2 then
begin
C := C or (S^ shl (B - 2));
Inc(S);
Dec(Len);
C := C or (S^ shr (7 - B));
Dec(B, 2);
end
else
begin
C := C or (S^ shr (2 - B));
Inc(B, 3);
end; //if
D^ := C;
Inc(D);
end; //while
end;
你在这段代码中使用了指针,不过java是不支持这个东西的,你这段代码是用来作什么的呢?
建议你抛开这点代码,看要实现什么,然后考虑用java怎么做
帮你up,没有做过,关注ing
同意kongxiangli(笑看红尘)
修改代码,还不如再编一个