Class BambooStreamBootstrapper


  • public final class BambooStreamBootstrapper
    extends com.ctc.wstx.io.InputBootstrapper
    Input bootstrap class used with streams, when encoding is not known (when encoding is specified by application, a reader is constructed, and then reader-based bootstrapper is used). Encoding used for an entity (including main document entity) is determined using algorithms suggested in XML 1.0#3 spec, appendix F
    • Method Detail

      • getInstance

        public static BambooStreamBootstrapper getInstance​(String pubId,
                                                           com.ctc.wstx.io.SystemId sysId,
                                                           InputStream in)
        Factory method used when the underlying data provider is an actual stream.
      • getInstance

        public static BambooStreamBootstrapper getInstance​(String pubId,
                                                           com.ctc.wstx.io.SystemId sysId,
                                                           byte[] data,
                                                           int start,
                                                           int end)
        Factory method used when the underlying data provider is a pre-allocated block source, and no stream is used. Additionally the buffer passed is not owned by the bootstrapper or Reader that is created, so it is not to be recycled.
      • getInputEncoding

        public String getInputEncoding()
        Since this class only gets used when encoding is not explicitly passed, need use the encoding that was auto-detected...
        Specified by:
        getInputEncoding in class com.ctc.wstx.io.InputBootstrapper
      • getInputTotal

        public int getInputTotal()
        Specified by:
        getInputTotal in class com.ctc.wstx.io.InputBootstrapper
      • getInputColumn

        public int getInputColumn()
        Specified by:
        getInputColumn in class com.ctc.wstx.io.InputBootstrapper
      • resolveStreamEncoding

        protected void resolveStreamEncoding()
                                      throws IOException,
                                             com.ctc.wstx.exc.WstxException
        Method called to try to figure out physical encoding the underlying input stream uses.
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • verifyXmlEncoding

        protected String verifyXmlEncoding​(String enc)
                                    throws com.ctc.wstx.exc.WstxException
        Returns:
        Normalized encoding name
        Throws:
        com.ctc.wstx.exc.WstxException
      • loadMore

        protected void loadMore()
                         throws IOException,
                                com.ctc.wstx.exc.WstxException
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • pushback

        protected void pushback()
        Specified by:
        pushback in class com.ctc.wstx.io.InputBootstrapper
      • getNext

        protected int getNext()
                       throws IOException,
                              com.ctc.wstx.exc.WstxException
        Specified by:
        getNext in class com.ctc.wstx.io.InputBootstrapper
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • getNextAfterWs

        protected int getNextAfterWs​(boolean reqWs)
                              throws IOException,
                                     com.ctc.wstx.exc.WstxException
        Specified by:
        getNextAfterWs in class com.ctc.wstx.io.InputBootstrapper
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • checkKeyword

        protected int checkKeyword​(String exp)
                            throws IOException,
                                   com.ctc.wstx.exc.WstxException
        Specified by:
        checkKeyword in class com.ctc.wstx.io.InputBootstrapper
        Returns:
        First character that does not match expected, if any; CHAR_NULL if match succeeded
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • readQuotedValue

        protected int readQuotedValue​(char[] kw,
                                      int quoteChar)
                               throws IOException,
                                      com.ctc.wstx.exc.WstxException
        Specified by:
        readQuotedValue in class com.ctc.wstx.io.InputBootstrapper
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • hasXmlDecl

        protected boolean hasXmlDecl()
                              throws IOException,
                                     com.ctc.wstx.exc.WstxException
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • getLocation

        protected Location getLocation()
        Specified by:
        getLocation in class com.ctc.wstx.io.InputBootstrapper
      • nextByte

        protected byte nextByte()
                         throws IOException,
                                com.ctc.wstx.exc.WstxException
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • skipSbWs

        protected int skipSbWs()
                        throws IOException,
                               com.ctc.wstx.exc.WstxException
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • skipSbLF

        protected void skipSbLF​(byte lfByte)
                         throws IOException,
                                com.ctc.wstx.exc.WstxException
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • checkSbKeyword

        protected int checkSbKeyword​(String expected)
                              throws IOException,
                                     com.ctc.wstx.exc.WstxException
        Returns:
        First character that does not match expected, if any; CHAR_NULL if match succeeded
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • nextMultiByte

        protected int nextMultiByte()
                             throws IOException,
                                    com.ctc.wstx.exc.WstxException
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • nextTranslated

        protected int nextTranslated()
                              throws IOException,
                                     com.ctc.wstx.exc.WstxException
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • skipMbWs

        protected int skipMbWs()
                        throws IOException,
                               com.ctc.wstx.exc.WstxException
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • skipTranslatedWs

        protected int skipTranslatedWs()
                                throws IOException,
                                       com.ctc.wstx.exc.WstxException
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • skipMbLF

        protected void skipMbLF​(int lf)
                         throws IOException,
                                com.ctc.wstx.exc.WstxException
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • skipTranslatedLF

        protected void skipTranslatedLF​(int lf)
                                 throws IOException,
                                        com.ctc.wstx.exc.WstxException
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • checkMbKeyword

        protected int checkMbKeyword​(String expected)
                              throws IOException,
                                     com.ctc.wstx.exc.WstxException
        Returns:
        First character that does not match expected, if any; CHAR_NULL if match succeeded
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException
      • checkTranslatedKeyword

        protected int checkTranslatedKeyword​(String expected)
                                      throws IOException,
                                             com.ctc.wstx.exc.WstxException
        Throws:
        IOException
        com.ctc.wstx.exc.WstxException