BtcByteStreamReader extension Models
Serial-friendly reading helpers on a byte stream such as BtcConnection.input or BtcReconnectingConnection.input.
Methods
-
decoded(
{Encoding encoding = utf8}) → Stream< String> -
Available on Stream<
Decodes incoming bytes to text as they arrive, correctly handling multi-byte characters split across chunk boundaries. Not line-buffered.Uint8List> , provided by the BtcByteStreamReader extension -
frames(
{List< int> delimiter = const [0x0A], int? maxFrameLength}) → Stream<Uint8List> -
Available on Stream<
Splits this stream intoUint8List> , provided by the BtcByteStreamReader extensiondelimiter-separated frames (delimiter stripped), reassembling frames that span multiple chunks. See BtcFrameSplitter. -
lengthFrames(
{int prefixLength = 1, bool bigEndian = true, bool lengthIncludesPrefix = false, int? maxFrameLength}) → Stream< Uint8List> -
Available on Stream<
Splits this stream into frames that each begin with their own length (the prefix stripped), reassembling frames that span multiple chunks. See BtcLengthFrameSplitter, which is the one to use for a binary protocol whose payload bytes could take any value.Uint8List> , provided by the BtcByteStreamReader extension -
lines(
{Encoding encoding = utf8, int? maxLineLength}) → Stream< String> -
Available on Stream<
Emits decoded text lines. Splits onUint8List> , provided by the BtcByteStreamReader extension\n, strips a trailing\rso both\n- and\r\n-terminated devices read cleanly, and decodes each line withencoding(UTF-8 by default).