read method
Is called when a value has to be decoded.
Implementation
@override
DOOConversation read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return DOOConversation(
id: fields[0] as int,
inboxId: fields[1] as int,
messages: (fields[2] as List).cast<DOOMessage>(),
contact: fields[3] as DOOContact,
);
}