def add_data(self, data):
        """Add data to the currently in progress entry.

        Args:
            data (bytes): The data that we want to add.

        Returns:
            int: An error code
        """

        if self.data_size - self.data_index < len(data):
            return Error.DESTINATION_BUFFER_TOO_SMALL

        if self.in_progress is not None:
            self.in_progress.data += data

        return Error.NO_ERROR
def add_data ( self , data ) : if self . data_size - self . data_index < len ( data ) : return Error . DESTINATION_BUFFER_TOO_SMALL if self . in_progress is not None : self . in_progress . data += data return Error . NO_ERROR
Add data to the currently in progress entry.

        Args:
            data (bytes): The data that we want to add.

        Returns:
            int: An error code