magicHeader static method

Transaction<Uint8List> magicHeader(
  1. Stream<Uint8List> stream,
  2. List<int> header, {
  3. int maxLen = 1024,
})

Create a transaction that uses MagicHeaderAndLengthByteTransformer

Transaction.magicHeader(p.inputStream, Uint8List.fromList([65,65,65])); // expects magic header AAA and then byte of length.

Implementation

static Transaction<Uint8List> magicHeader(
    Stream<Uint8List> stream, List<int> header,
    {int maxLen = 1024}) {
  return Transaction<Uint8List>(
      stream,
      MagicHeaderAndLengthByteTransformer.broadcast(
          header: header, maxLen: maxLen));
}