'Read a box and return the info as a tuple: (box_size, box_type, box_data)'

def read_box_info(self):

    real_size = size = self.read_unsigned_int()
    box_type = self.read_bytes(4)
    header_end = 8
    if (size == 1):
        real_size = self.read_unsigned_long_long()
        header_end = 16
    return (real_size, box_type, self.read_bytes((real_size - header_end)))
