setswab - sets the binary file "swap bytes" flag
file.setswab(bSwab)
Binary-mode files may be byte-swapped for
read() and write() using the
setswab() intrinsic method. The input
bSwab is either true or
false. If enabled, byte swaps are performed as
follows:
| Base Type | Bytes | Byte swap |
|---|---|---|
Bool, Char, Byte, Ubyte |
1 | n/a |
Short, Ushort, Half |
2 | AB -> BA |
WideChar, Int, Uint, Float |
4 | ABCD -> DCBA |
Long, Ulong, Double |
8 | ABCDEFGH -> HGFEDCBA |
None
ArgCheck if an incorrect number of arguments
are specified
TypeCheck if file is
not a File or bSwab is not a
Bool
AccessCheck if
file is closed or if not a binary-mode file.
file.setswab();