Class XMLInput

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class XMLInput
    extends InputStream
    This class provides methods for reading XML input and recursive entities. The input encoding will be guessed by analyzing the first bytes.
    Author:
    BaseX Team 2005-24, BSD License, Christian Gruen
    • Constructor Detail

      • XMLInput

        public XMLInput​(IO io)
                 throws IOException
        Constructor.
        Parameters:
        io - input reference
        Throws:
        IOException - I/O exception
    • Method Detail

      • encoding

        public void encoding​(String e)
                      throws IOException
        Sets a new encoding.
        Parameters:
        e - encoding
        Throws:
        IOException - I/O exception
      • io

        public IO io()
        Returns the IO reference.
        Returns:
        file reference
      • prev

        public void prev​(int p)
        Jumps the specified number of characters back.
        Parameters:
        p - number of characters
      • add

        public boolean add​(byte[] value,
                           boolean spaces)
                    throws IOException
        Inserts some bytes in the input stream.
        Parameters:
        value - values to insert
        spaces - add spaces
        Returns:
        true if everything went alright
        Throws:
        IOException - I/O exception
      • pos

        public int pos()
        Returns the current file position.
        Returns:
        file position
      • line

        public int line()
        Returns the current line.
        Returns:
        line
      • length

        public long length()
        Returns the file length.
        Returns:
        file position