BtcByteStreamReader extension Models

Serial-friendly reading helpers on a byte stream such as BtcConnection.input or BtcReconnectingConnection.input.

on

Methods

decoded({Encoding encoding = utf8}) Stream<String>

Available on Stream<Uint8List>, provided by the BtcByteStreamReader extension

Decodes incoming bytes to text as they arrive, correctly handling multi-byte characters split across chunk boundaries. Not line-buffered.
frames({List<int> delimiter = const [0x0A], int? maxFrameLength}) Stream<Uint8List>

Available on Stream<Uint8List>, provided by the BtcByteStreamReader extension

Splits this stream into delimiter-separated frames (delimiter stripped), reassembling frames that span multiple chunks. See BtcFrameSplitter.
lines({Encoding encoding = utf8, int? maxLineLength}) Stream<String>

Available on Stream<Uint8List>, provided by the BtcByteStreamReader extension

Emits decoded text lines. Splits on \n, strips a trailing \r so both \n- and \r\n-terminated devices read cleanly, and decodes each line with encoding (UTF-8 by default).