def set_data_length(self, length):
        # type: (int) -> None
        '''
        A method to set the length of the data that this UDF File Entry
        points to.

        Parameters:
         length - The new length for the data.
        Returns:
         Nothing.
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('Directory Record not yet initialized')

        len_diff = length - self.info_len
        if len_diff > 0:
            # If we are increasing the length, update the last alloc_desc up
            # to the max of 0x3ffff800, and throw an exception if we overflow.
            new_len = self.alloc_descs[-1][0] + len_diff
            if new_len > 0x3ffff800:
                raise pycdlibexception.PyCdlibInvalidInput('Cannot increase the size of a UDF file beyond the current descriptor')
            self.alloc_descs[-1][0] = new_len
        elif len_diff < 0:
            # We are decreasing the length.  It's possible we are removing one
            # or more alloc_descs, so run through the list updating all of the
            # descriptors and remove any we no longer need.
            len_left = length
            alloc_descs_needed = 0
            index = 0
            while len_left > 0:
                this_len = min(len_left, 0x3ffff800)
                alloc_descs_needed += 1
                self.alloc_descs[index][0] = this_len
                index += 1
                len_left -= this_len

            self.alloc_descs = self.alloc_descs[:alloc_descs_needed]

        self.info_len = length
def set_data_length ( self , length ) : if not self . _initialized : raise pycdlibexception . PyCdlibInternalError ( 'Directory Record not yet initialized' ) len_diff = length - self . info_len if len_diff > 0 : new_len = self . alloc_descs [ - 1 ] [ 0 ] + len_diff if new_len > 0x3ffff800 : raise pycdlibexception . PyCdlibInvalidInput ( 'Cannot increase the size of a UDF file beyond the current descriptor' ) self . alloc_descs [ - 1 ] [ 0 ] = new_len elif len_diff < 0 : len_left = length alloc_descs_needed = 0 index = 0 while len_left > 0 : this_len = min ( len_left , 0x3ffff800 ) alloc_descs_needed += 1 self . alloc_descs [ index ] [ 0 ] = this_len index += 1 len_left -= this_len self . alloc_descs = self . alloc_descs [ : alloc_descs_needed ] self . info_len = length
A method to set the length of the data that this UDF File Entry
        points to.

        Parameters:
         length - The new length for the data.
        Returns:
         Nothing.