Method called to do actual bootstrapping.

@return Actual reader to use for reading xml content
773767
@Override
    public Reader bootstrapInput(ReaderConfig cfg, boolean mainDoc, int xmlVersion)
        throws IOException, XMLStreamException
    {
        /* First order of business: allocate input buffer. Not done during
         * construction for simplicity; that way config object need not be
         * passed before actual bootstrap method is called
         */
        /* Let's make sure buffer is at least 6 chars (to know '<?xml '
         * prefix), and preferably big enough to contain the whole declaration,
         *  but not too long to waste space -- it won't be reused
         * by the real input reader.
         */
        mCharBuffer = (cfg == null) ? new char[128] : cfg.allocSmallCBuffer(128); // 128 chars should be enough

        initialLoad(7);

        /* Only need 6 for signature ("<?xml\s"), but there may be a leading
         * BOM in there... and a valid xml declaration has to be longer
         * than 7 chars anyway (although, granted, shortest valid xml docl
         * is just 4 chars... "<a/>")
         */
        if (mInputEnd >= 7) {
            char c = mCharBuffer[mInputPtr];
            
            // BOM to skip?
            if (c == CHAR_BOM_MARKER) {
                c = mCharBuffer[++mInputPtr];
            }
            if (c == '<') {
                if (mCharBuffer[mInputPtr+1] == '?'
                    && mCharBuffer[mInputPtr+2] == 'x'
                    && mCharBuffer[mInputPtr+3] == 'm'
                    && mCharBuffer[mInputPtr+4] == 'l'
                    && mCharBuffer[mInputPtr+5] <= CHAR_SPACE) {
                    // Yup, got the declaration ok!
                    mInputPtr += 6; // skip declaration
                    readXmlDecl(mainDoc, xmlVersion);
                    
                    if (mFoundEncoding != null && mInputEncoding != null) {
                        verifyXmlEncoding(cfg);
                    }
                }
            } else {
                /* We may also get something that would be invalid xml
                 * ("garbage" char; neither '<' nor space). If so, and
                 * it's one of "well-known" cases, we can not only throw
                 * an exception but also indicate a clue as to what is likely
                 * to be wrong.
                 */
                /* Specifically, UTF-8 read via, say, ISO-8859-1 reader, can
                 * "leak" marker (0xEF, 0xBB, 0xBF). While we could just eat
                 * it, there's bound to be other problems cropping up, so let's
                 * inform about the problem right away.
                 */
                if (c == 0xEF) {
                    throw new WstxIOException("Unexpected first character (char code 0xEF), not valid in xml document: could be mangled UTF-8 BOM marker. Make sure that the Reader uses correct encoding or pass an InputStream instead");
                }
            }
        }
 
        /* Ok, now; do we have unused chars we have read that need to
         * be merged in?
         */
        if (mInputPtr < mInputEnd) {
            return new MergedReader(cfg, mIn, mCharBuffer, mInputPtr, mInputEnd);
        }

        return mIn;
    }
805790
private function bootstrap()
    {
        if (Configuration::read('bootstrap.enable') === true) {
            $applicationNamespace = Configuration::read('application.namespace');
            $bootstrapNamespace = $applicationNamespace . '\Bootstrap';
            if (!class_exists($bootstrapNamespace)) {
                throw new \Exception('Bootstrap "' . $bootstrapNamespace . '" doesn\' exist.');
                return false;
            }
            $bootstrap = new $bootstrapNamespace();
            if (!method_exists($bootstrap, 'initialize')) {
                $errorMessage = 'initialize() method isn\'t available in Bootstrap "' . $bootstrapNamespace . '".<br />';
                $errorMessage .= 'Your bootstrap may not extends \Pabana\Core\Bootstrap.';
                throw new \Exception($errorMessage);
                return false;
            }
            $bootstrap->initialize();
            return true;
        }
        return false;
    }
146454
public XMLReader getXMLReader() throws SAXException
    {
        XMLFilter filter = _Verifier.getVerifierFilter();
        filter.setParent(_WrappedParser.getXMLReader());
        return filter;
    }
1234318
@Override
    protected EntityReader getReader() {
        if (reader == null) {
            reader = new CassandraEntityReader(kunderaQuery, kunderaMetadata);
        }
        return reader;
    }
1146946
private BootstrapHandler loadBootstrap(String bootstrapClassName)
      throws ClassNotFoundException, IllegalAccessException, InstantiationException {
    return classLoader.loadClass(bootstrapClassName).asSubclass(BootstrapHandler.class).newInstance();
  }
1239767
private function createReader()
    {
        $reader = phpiredis_reader_create();

        phpiredis_reader_set_status_handler($reader, $this->getStatusHandler());
        phpiredis_reader_set_error_handler($reader, $this->getErrorHandler());

        return $reader;
    }
1222689
public function bootstrap(): self
    {
        if (!$this->info->installMode()) {
            $this->getApplicationInitializer()->init($this);
            $this->emit('system.init');

            return $this;
        }

        $manager = $this->moduleManager();

        /** @var Module|null $installer */
        $installer = null;

        foreach ($manager->modules() as $module) {
            if ($module->isApplicationInstaller()) {
                if ($installer !== null) {
                    $formatText = '%s was defined as an application installer before %s';
                    $formatArgs = [$installer->name(), $module->name()];
                    throw new \RuntimeException(vsprintf($formatText, $formatArgs));
                }

                $installer = $module;
            }
        }

        if ($installer === null) {
            throw new \RuntimeException("No application installer was found");
        }

        $enabled = [$installer->name() => Module::ENABLED];

        foreach ($manager->recursiveDependencies($installer) as $module) {
            $enabled[$module->name()] = Module::ENABLED;
        }

        $this->getApplicationInitializer()->init($this);
        $manager->setStatusList($enabled);

        $this->emit('system.init');

        return $this;
    }
345484
public Object read() throws IOException {
        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.fine("Reading "+file);
        }
        try (InputStream in = new BufferedInputStream(Files.newInputStream(file.toPath()))) {
            return xs.fromXML(in);
        } catch (RuntimeException | Error e) {
            throw new IOException("Unable to read "+file,e);
        }
    }
393195
protected SAXReader createXmlReader() {
        SAXReader xmlReader = new SAXReader();
        xmlReader.setMergeAdjacentText(true);
        xmlReader.setStripWhitespaceText(true);
        xmlReader.setIgnoreComments(true);

        try {
            xmlReader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
            xmlReader.setFeature("http://xml.org/sax/features/external-general-entities", false);
            xmlReader.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
        }catch (SAXException ex){
            LOGGER.error("Unable to turn off external entity loading, This could be a security risk.", ex);
        }

        return xmlReader;
    }
524347
private XMLReader fetchSheetReader() throws SAXException {
		XMLReader xmlReader = null;
		try {
			xmlReader = XMLReaderFactory.createXMLReader(CLASS_SAXPARSER);
		} catch (SAXException e) {
			if (e.getMessage().contains("org.apache.xerces.parsers.SAXParser")) {
				throw new DependencyException(e, "You need to add 'xerces:xercesImpl' to your project and version >= 2.11.0");
			} else {
				throw e;
			}
		}
		xmlReader.setContentHandler(this);
		return xmlReader;
	}
1104328
public function getReader()
    {
        if ($this->reader) {
            return $this->reader;
        }

        $className = $this->getDoctrineAnnotationReaderClassName();

        $r = new ReflectionClass($className);

        $instance = $r->newInstance();

        if (!$instance instanceof DoctrineAnnotationsReaderInterface) {
            $errMsg = sprintf('Reader not implement %s', DoctrineAnnotationsReaderInterface::class);
            throw new Exception\InvalidDoctrineAnnotationsReaderException($errMsg);
        }

        $this->reader = $instance;

        return $this->reader;
    }
627221
public function readString()
    {
        // Compatibility libxml 20620 (2.6.20) or later - LIBXML_VERSION  / LIBXML_DOTTED_VERSION
        if (method_exists($this->reader, 'readString')) {
            return $this->reader->readString();
        }

        if (0 === $this->reader->nodeType) {
            return '';
        }

        if (false === $node = $this->reader->expand()) {
            throw new BadMethodCallException('Unable to expand node.');
        }

        return $node->textContent;
    }
742456
public function current()
    {
        $leftRow = $this->leftReader->current();

        if (array_key_exists($this->nestKey, $leftRow)) {
            throw new ReaderException(
                sprintf(
                    'Left Row: "%s" Reader already contains a field named "%s". Please choose a different nest key field',
                    $this->key(),
                    $this->nestKey
                )
            );
        }
        $leftRow[$this->nestKey] = [];

        $leftId     = $this->getRowId($leftRow, $this->leftJoinField);
        $rightRow   = $this->rightReader->current();
        $rightId    = $this->getRowId($rightRow, $this->rightJoinField);

        while ($leftId == $rightId && $this->rightReader->valid()) {

            $leftRow[$this->nestKey][] = $rightRow;
            $this->rightReader->next();

            $rightRow = $this->rightReader->current();

            if($this->rightReader->valid()) {
                $rightId = $this->getRowId($rightRow, $this->rightJoinField);
            }
        }

        return $leftRow;
    }
1018878
def NewWalker(self, reader):
        
        if reader is None: reader__o = None
        else: reader__o = reader._o
        ret = libxml2mod.xmlReaderNewWalker(reader__o, self._o)
        return ret
930148
public BufferedReader getReader()
    	throws UnsupportedEncodingException
    {
        if (_inputState!=0 && _inputState!=2)
            throw new IllegalStateException();
        if (_reader==null)
        {
            String encoding=getCharacterEncoding();
            if (encoding==null)
                encoding=StringUtil.__ISO_8859_1;
            _reader=new BufferedReader(new InputStreamReader(getInputStream(),encoding));
            
        }
        _inputState=2;
        return _reader;
    }
81279
public Reader asReader() {
        Reader r = getReader();
        if (r != null) return r;
        String s = getString();
        if (s != null) return new StringReader(s);
        InputStream is = fromStreamOrBufferOrUrl();
        if (is != null) return readerFrom(is);
        throw resourceUnaccessible();
    }
856999
public static AnnotationMappingInfo load(final Reader reader) throws XmlOperateException {
        ArgUtils.notNull(reader, "reader");
        
        final AnnotationMappingInfo xmlInfo;
        
        try {
            xmlInfo = JAXB.unmarshal(reader, AnnotationMappingInfo.class);
        } catch (DataBindingException e) {
            throw new XmlOperateException("fail load xml with JAXB.", e);
        }
        
        return xmlInfo;
    }