UpdatesDifferenceSlice.deserialize constructor

UpdatesDifferenceSlice.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory UpdatesDifferenceSlice.deserialize(BinaryReader reader) {
  // Read [UpdatesDifferenceSlice] 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 intermediateState = reader.readObject() as UpdatesStateBase;

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

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