read method
Is called when a value has to be decoded.
Implementation
@override
Connection read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return Connection(
fields[0] as String,
fields[1] as String,
fields[2] as String,
);
}