List<int> reverseBuf(List<int> buf) { List<int> buf2 = List.filled(buf.length, 0); for (var i = 0; i < buf.length; i++) { buf2[i] = buf[buf.length - 1 - i]; } return buf2; }