StreamReader constructor

StreamReader(
  1. dynamic data
)

Implementation

factory StreamReader(dynamic data) {
  if (data is ByteData) {
    // Move the readIndex forward for the binary reader.
    return BlockReader(data)
      ..readUint8('F')
      ..readUint8('L')
      ..readUint8('A')
      ..readUint8('R')
      ..readUint8('E');
  } else if (data is Map) {
    return JSONBlockReader(data);
  } else {
    throw ArgumentError('Unexpected type for data');
  }
}