Examples of Stax2ByteArraySource


Examples of org.codehaus.stax2.io.Stax2ByteArraySource

            try {
    /* 11-Nov-2008, TSa: Let's add optimized handling for byte-block
     *   source
     */
    if (src instanceof Stax2ByteArraySource) {
        Stax2ByteArraySource bas = (Stax2ByteArraySource) src;
        bs = StreamBootstrapper.getInstance(pubId, sysId, bas.getBuffer(), bas.getBufferStart(), bas.getBufferEnd());
    } else {
        in = ss.constructInputStream();
        if (in == null) {
      r = ss.constructReader();
        }
View Full Code Here

Examples of org.codehaus.stax2.io.Stax2ByteArraySource

     * this StaxMate factory was constructed with.
     */
    public XMLStreamReader2 createStax2Reader(byte[] data, int offset, int len)
        throws XMLStreamException
    {
        Stax2ByteArraySource src = new Stax2ByteArraySource(data, offset, len);
        if (mStax2Factory != null) {
            return (XMLStreamReader2) mStax2Factory.createXMLStreamReader(src);
        }
        try {
            XMLStreamReader sr = mStaxFactory.createXMLStreamReader(src.constructInputStream());
            return Stax2ReaderAdapter.wrapIfNecessary(sr);
        } catch (IOException ioe) {
            throw new XMLStreamException(ioe);
        }
    }
View Full Code Here

Examples of org.codehaus.stax2.io.Stax2ByteArraySource

    protected FromXmlParser _createParser(byte[] data, int offset, int len, IOContext ctxt)
        throws IOException, JsonParseException
    {
        XMLStreamReader sr;
        try {
            sr = _xmlInputFactory.createXMLStreamReader(new Stax2ByteArraySource(data, offset, len));
            sr = _initializeXmlReader(sr);
        } catch (XMLStreamException e) {
            return StaxUtil.throwXmlAsIOException(e);
        }
        FromXmlParser xp = new FromXmlParser(ctxt, _generatorFeatures, _xmlGeneratorFeatures,
View Full Code Here

Examples of org.codehaus.stax2.io.Stax2ByteArraySource

         */
        ReaderConfig cfg = getNonSharedConfig(ss.getPublicId(), ss.getSystemId(), ss.getEncoding(), forEventReader, true);

        // Byte arrays can be accessed VERY efficiently...
        if (ss instanceof Stax2ByteArraySource) {
            Stax2ByteArraySource bs = (Stax2ByteArraySource) ss;
            return StreamReaderImpl.construct(ByteSourceBootstrapper.construct
                                              (cfg, bs.getBuffer(), bs.getBufferStart(), bs.getBufferLength()));
        }
        if (ss instanceof Stax2CharArraySource) {
            Stax2CharArraySource cs = (Stax2CharArraySource) ss;
            return StreamReaderImpl.construct(CharSourceBootstrapper.construct
                                              (cfg, cs.getBuffer(), cs.getBufferStart(), cs.getBufferLength()));
View Full Code Here

Examples of org.codehaus.stax2.io.Stax2ByteArraySource

         */
        ReaderConfig cfg = getNonSharedConfig(ss.getPublicId(), ss.getSystemId(), ss.getEncoding(), forEventReader, true);

        // Byte arrays can be accessed VERY efficiently...
        if (ss instanceof Stax2ByteArraySource) {
            Stax2ByteArraySource bs = (Stax2ByteArraySource) ss;
            return StreamReaderImpl.construct(ByteSourceBootstrapper.construct
                                              (cfg, bs.getBuffer(), bs.getBufferStart(), bs.getBufferLength()));
        }
        if (ss instanceof Stax2CharArraySource) {
            Stax2CharArraySource cs = (Stax2CharArraySource) ss;
            return StreamReaderImpl.construct(CharSourceBootstrapper.construct
                                              (cfg, cs.getBuffer(), cs.getBufferStart(), cs.getBufferLength()));
View Full Code Here

Examples of org.codehaus.stax2.io.Stax2ByteArraySource

         */
        ReaderConfig cfg = getNonSharedConfig(ss.getPublicId(), ss.getSystemId(), ss.getEncoding(), forEventReader, true);

        // Byte arrays can be accessed VERY efficiently...
        if (ss instanceof Stax2ByteArraySource) {
            Stax2ByteArraySource bs = (Stax2ByteArraySource) ss;
            return StreamReaderImpl.construct(ByteSourceBootstrapper.construct
                                              (cfg, bs.getBuffer(), bs.getBufferStart(), bs.getBufferLength()));
        }
        if (ss instanceof Stax2CharArraySource) {
            Stax2CharArraySource cs = (Stax2CharArraySource) ss;
            return StreamReaderImpl.construct(CharSourceBootstrapper.construct
                                              (cfg, cs.getBuffer(), cs.getBufferStart(), cs.getBufferLength()));
View Full Code Here

Examples of org.codehaus.stax2.io.Stax2ByteArraySource

            try {
    /* 11-Nov-2008, TSa: Let's add optimized handling for byte-block
     *   source
     */
    if (src instanceof Stax2ByteArraySource) {
        Stax2ByteArraySource bas = (Stax2ByteArraySource) src;
        bs = StreamBootstrapper.getInstance(pubId, sysId, bas.getBuffer(), bas.getBufferStart(), bas.getBufferEnd());
    } else {
        in = ss.constructInputStream();
        if (in == null) {
      r = ss.constructReader();
        }
View Full Code Here

Examples of org.codehaus.stax2.io.Stax2ByteArraySource

     * this StaxMate factory was constructed with.
     */
    public XMLStreamReader2 createStax2Reader(byte[] data, int offset, int len)
        throws XMLStreamException
    {
        Stax2ByteArraySource src = new Stax2ByteArraySource(data, offset, len);
        if (_stax2Factory != null) {
            return (XMLStreamReader2) _stax2Factory.createXMLStreamReader(src);
        }
        try {
            XMLStreamReader sr = _staxFactory.createXMLStreamReader(src.constructInputStream());
            return wrapIfNecessary(sr);
        } catch (IOException ioe) {
            throw new XMLStreamException(ioe);
        }
    }
View Full Code Here

Examples of org.codehaus.stax2.io.Stax2ByteArraySource

    @Override
    protected FromXmlParser _createParser(byte[] data, int offset, int len, IOContext ctxt) throws IOException
    {
        XMLStreamReader sr;
        try {
            sr = _xmlInputFactory.createXMLStreamReader(new Stax2ByteArraySource(data, offset, len));
            sr = _initializeXmlReader(sr);
        } catch (XMLStreamException e) {
            return StaxUtil.throwXmlAsIOException(e);
        }
        FromXmlParser xp = new FromXmlParser(ctxt, _generatorFeatures, _xmlGeneratorFeatures,
View Full Code Here

Examples of org.codehaus.stax2.io.Stax2ByteArraySource

    protected FromXmlParser _createJsonParser(byte[] data, int offset, int len, IOContext ctxt)
        throws IOException, JsonParseException
    {
        XMLStreamReader sr;
        try {
            sr = _xmlInputFactory.createXMLStreamReader(new Stax2ByteArraySource(data, offset, len));
            sr = _initializeXmlReader(sr);
        } catch (XMLStreamException e) {
            return StaxUtil.throwXmlAsIOException(e);
        }
        return new FromXmlParser(ctxt, _generatorFeatures, _xmlGeneratorFeatures,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.