onData method
Receive new data from the parent stream
Buffer the data until we have enough to emit and int, then parse and emit said int
Implementation
@override
void onData(List<int> data) {
_buffer.addAll(data);
while (_buffer.length >= bytesPerElement) {
final bytes = _buffer.take(bytesPerElement).toList();
_controller.add(_transformer(bytes));
_buffer.removeRange(0, bytesPerElement);
}
}