def parse(cls, fptr, offset, length):
        """Parse data reference box.

        Parameters
        ----------
        fptr : file
            Open file object.
        offset : int
            Start position of box in bytes.
        length : int
            Length of the box in bytes.

        Returns
        -------
        DataReferenceBox
            Instance of the current data reference box.
        """
        num_bytes = offset + length - fptr.tell()
        read_buffer = fptr.read(num_bytes)

        # Read the number of data references
        ndr, = struct.unpack_from('>H', read_buffer, offset=0)

        # Need to keep track of where the next url box starts.
        box_offset = 2

        data_entry_url_box_list = []
        for j in range(ndr):

            # Create an in-memory binary stream for each URL box.
            box_fptr = io.BytesIO(read_buffer[box_offset:])
            box_buffer = box_fptr.read(8)
            (box_length, box_id) = struct.unpack_from('>I4s', box_buffer,
                                                      offset=0)
            box = DataEntryURLBox.parse(box_fptr, 0, box_length)

            # Need to adjust the box start to that of the "real" file.
            box.offset = offset + 8 + box_offset
            data_entry_url_box_list.append(box)

            # Point to the next embedded URL box.
            box_offset += box_length

        return cls(data_entry_url_box_list, length=length, offset=offset)
def parse ( cls , fptr , offset , length ) : num_bytes = offset + length - fptr . tell ( ) read_buffer = fptr . read ( num_bytes ) ndr , = struct . unpack_from ( '>H' , read_buffer , offset = 0 ) box_offset = 2 data_entry_url_box_list = [ ] for j in range ( ndr ) : box_fptr = io . BytesIO ( read_buffer [ box_offset : ] ) box_buffer = box_fptr . read ( 8 ) ( box_length , box_id ) = struct . unpack_from ( '>I4s' , box_buffer , offset = 0 ) box = DataEntryURLBox . parse ( box_fptr , 0 , box_length ) box . offset = offset + 8 + box_offset data_entry_url_box_list . append ( box ) box_offset += box_length return cls ( data_entry_url_box_list , length = length , offset = offset )
Parse data reference box.

        Parameters
        ----------
        fptr : file
            Open file object.
        offset : int
            Start position of box in bytes.
        length : int
            Length of the box in bytes.

        Returns
        -------
        DataReferenceBox
            Instance of the current data reference box.