'Write tag data into the Theora comment packet/page.'

def _inject(self, fileobj, padding_func):

    fileobj.seek(0)
    page = OggPage(fileobj)
    while (not page.packets[0].startswith('\x81theora')):
        page = OggPage(fileobj)
    old_pages = [page]
    while (not (old_pages[(-1)].complete or (len(old_pages[(-1)].packets) > 1))):
        page = OggPage(fileobj)
        if (page.serial == old_pages[0].serial):
            old_pages.append(page)
    packets = OggPage.to_packets(old_pages, strict=False)
    content_size = (get_size(fileobj) - len(packets[0]))
    vcomment_data = ('\x81theora' + self.write(framing=False))
    padding_left = (len(packets[0]) - len(vcomment_data))
    info = PaddingInfo(padding_left, content_size)
    new_padding = info._get_padding(padding_func)
    packets[0] = (vcomment_data + ('\x00' * new_padding))
    new_pages = OggPage._from_packets_try_preserve(packets, old_pages)
    OggPage.replace(fileobj, old_pages, new_pages)
