MessagePeerVote.deserialize constructor

MessagePeerVote.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory MessagePeerVote.deserialize(BinaryReader reader) {
  // Read [MessagePeerVote] fields.
  final peer = reader.readObject() as PeerBase;
  final option = reader.readBytes();
  final date = reader.readDateTime();

  // Construct [MessagePeerVote] object.
  final returnValue = MessagePeerVote(
    peer: peer,
    option: option,
    date: date,
  );

  // Now return the deserialized [MessagePeerVote].
  return returnValue;
}