reverseBytes static method

List<int> reverseBytes(
  1. List<int> bytes
)

Reverses the order of bytes in a list.

Example:

final original = [1, 2, 3, 4];
final reversed = Byte.reverseBytes(original);  // [4, 3, 2, 1]

Implementation

static List<int> reverseBytes(List<int> bytes) {
  return bytes.reversed.toList();
}