readValueOfType method

  1. @override
dynamic readValueOfType(
  1. dynamic type,
  2. ReadBuffer buffer
)
override

Reads a value of the indicated type from buffer.

The codec can be extended by overriding this method, calling super for types that the extension does not handle. See the discussion at writeValue.

Implementation

@override
dynamic readValueOfType(dynamic type, ReadBuffer buffer) {
  switch (type) {
    case _valueAdRequest:
      return EyuAd(
        readValueOfType(buffer.getUint8(), buffer),
        readValueOfType(buffer.getUint8(), buffer),
        readValueOfType(buffer.getUint8(), buffer),
        readValueOfType(buffer.getUint8(), buffer),
        readValueOfType(buffer.getUint8(), buffer),
        readValueOfType(buffer.getUint8(), buffer),
      );

    case _valueAdError:
      return AdError(
          readValueOfType(buffer.getUint8(), buffer),
          readValueOfType(buffer.getUint8(), buffer));

    default:
      return super.readValueOfType(type, buffer);
  }
}