void ImageDocumentTest::loadImage() {
  DocumentParser* parser = document().implicitOpen(
      ParserSynchronizationPolicy::ForceSynchronousParsing);
  const Vector<unsigned char>& data = jpegImage();
  parser->appendBytes(reinterpret_cast<const char*>(data.data()), data.size());
  parser->finish();
}
Exemple #2
0
void DocumentWriter::addData(const char* str, int len, bool flush)
{
    if (len == -1)
        len = strlen(str);

    DocumentParser* parser = m_frame->document()->parser();
    if (parser)
        parser->appendBytes(this, str, len, flush);
}