Class XMLInput

java.lang.Object
java.io.InputStream
org.basex.io.in.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-21, BSD License, Christian Gruen
  • Constructor Details

    • XMLInput

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

    • 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
    • read

      public int read() throws IOException
      Specified by:
      read in class InputStream
      Throws:
      IOException
    • 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
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class InputStream
      Throws:
      IOException
    • 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