ToLEBytes method

L ToLEBytes(
  1. S ptr,
  2. int length
)

Serialises length words starting at ptr to a flat little-endian byte list.

Each word is split into byteSize bytes, least-significant byte first.

Implementation

L ToLEBytes(S ptr, int length) =>
  fromList(asDartList(ptr, length).expand((word) =>
    .generate(byteSize, (i) => (word.toInt() >> (i * 8)) & 0xFF)
  ));