Is called when a value has to be encoded.
@override void write(BinaryWriter writer, Category obj) { writer.writeByte(0); }