List<T> read(int length) { final list = <T>[]; for (int i = 0; i < length && _buffer.isNotEmpty; i++) { list.add(_buffer.removeFirst()); _bytesRead++; } return list; }