JCL Help:ReverseBytes@Cardinal
JCL Help: ReverseBytes Function
Search in JCL Help
Search in all projects
Summary
Reverses the bytes of Value.
Pascal
function ReverseBytes(Value: Word): Word; overload;
function ReverseBytes(Value: Smallint): Smallint; overload;
function ReverseBytes(Value: Integer): Integer; overload;
function ReverseBytes(Value: Cardinal): Cardinal; overload;
function ReverseBytes(Value: Int64): Int64; overload;
function ReverseBytes(P: Pointer; Count: Integer): Pointer; overload;
Parameters
Parameters | Description |
Value: Word | The integer type whose bytes to reverse. |
P: Pointer | Address of a buffer whose bytes to reverse. |
Count: Integer | Size of the buffer, in bytes, specified by P. |
Return Value
Copy of Value with it's bits reversed.
Description
ReverseBytes reverses the bytes in the supplied parameter. That is, assuming an Integer, byte 0 is swapped with byte 3, byte 1 is swapped with byte 2. This function exists in 5 forms, one for each Integer type. The last overload is a generalisation of this which reverses the bytes in the supplied buffer.
About
Unit
Donator
Team JCL
Notes
The pointer returned by the Pointer overload points to the same buffer passed in as it's argument, iow it's not a newly allocated buffer. The ReverseBytes function was inspired by code from Liran Shahar
Contribute to this help topic
This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page