byteSwapper

Swap the bytes of every element before handing to next processor. The littleEndian compile-time parameter indicates what endianness the data is in. If it matches the platform's endianness, then nothing is done (no byte swap occurs). Otherwise, a byte swap processor is returned wrapping the io pipe.

Note, the width of the elements in the iopipe's window must be 2 or 4 bytes wide, and mutable.

byteSwapper
(
bool littleEndian = !IsLittleEndian
Chain
)
(
Chain c
)
if (
isIopipe!(Chain) &&
is(typeof(swapBytes(c.window)))
)

Parameters

c Chain

Source pipe chain for the byte swapper.

Return Value

Type: auto

If endianness of the source matches platform, this returns c, otherwise, it returns a byte swapping iopipe wrapper that performs the byte swaps.

Meta