function LittleToBigEndianWord(Value: Word): Word; overload;
begin
Result := ((Value and $00FF) shl 8) + ((Value and $FF00) shr 8);
end;
function LittleToBigEndianLongWord(Value: LongWord): LongWord; overload
begin
Result := ((Value and $000000FF) shl 24) + ((Value and $0000FF00) shl 8) +
((Value and $00FF0000) shr 8) + ((Value and $FF000000) shr 24);
end;
그냥 비트연산해서 상하위바이트바꾸어주시면 되는데.... 쩝
function LittleToBigEndianWord(Value: Word): Word; overload;
begin
Result := ((Value and $00FF) shl 8) + ((Value and $FF00) shr 8);
end;
function LittleToBigEndianLongWord(Value: LongWord): LongWord; overload
begin
Result := ((Value and $000000FF) shl 24) + ((Value and $0000FF00) shl 8) +
((Value and $00FF0000) shr 8) + ((Value and $FF000000) shr 24);
end;
^^ 항상 즐코하세요...