StreamReader constructor

StreamReader(
  1. dynamic data
)

Implementation

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