CommunityPeer.deserialize constructor

CommunityPeer.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory CommunityPeer.deserialize(BinaryReader reader) {
  // Read [CommunityPeer] fields.
  final flags = reader.readInt32();
  final canViewHistory = (flags & 4) != 0;
  final visible = (flags & 1) != 0 ? reader.readBool() : null;
  final peer = reader.readObject() as PeerBase;

  // Construct [CommunityPeer] object.
  final returnValue = CommunityPeer(
    canViewHistory: canViewHistory,
    visible: visible,
    peer: peer,
  );

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