UpdatesDifference.deserialize constructor

UpdatesDifference.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory UpdatesDifference.deserialize(BinaryReader reader) {
  // Read [UpdatesDifference] fields.
  final newMessages = reader.readVectorObject<MessageBase>();
  final newEncryptedMessages =
      reader.readVectorObject<EncryptedMessageBase>();
  final otherUpdates = reader.readVectorObject<UpdateBase>();
  final chats = reader.readVectorObject<ChatBase>();
  final users = reader.readVectorObject<UserBase>();
  final state = reader.readObject() as UpdatesStateBase;

  // Construct [UpdatesDifference] object.
  final returnValue = UpdatesDifference(
    newMessages: newMessages,
    newEncryptedMessages: newEncryptedMessages,
    otherUpdates: otherUpdates,
    chats: chats,
    users: users,
    state: state,
  );

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