org.basex.build.xml
Class XMLInput

java.lang.Object
  extended by org.basex.build.xml.XMLInput

public final class XMLInput
extends Object

This class provides a convenient access to the XML input.

Author:
Workgroup DBIS, University of Konstanz 2005-10, ISC License, Christian Gruen

Constructor Summary
XMLInput(IO f)
          Constructor.
 
Method Summary
 boolean add(byte[] val, boolean s)
          Inserts some bytes in the input stream.
 void encoding(String e)
          Sets a new encoding.
 void finish()
          Finishes file input.
 long length()
          Returns the file length.
 int next()
          Reads the next character from the cached input buffers.
 int pos()
          Returns the current file position.
 void prev(int p)
          Jumps the specified number of characters back.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLInput

public XMLInput(IO f)
         throws IOException
Constructor.

Parameters:
f - file 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

prev

public void prev(int p)
Jumps the specified number of characters back.

Parameters:
p - number of characters

next

public int next()
         throws IOException
Reads the next character from the cached input buffers.

Returns:
next character
Throws:
IOException - I/O exception

add

public boolean add(byte[] val,
                   boolean s)
Inserts some bytes in the input stream.

Parameters:
val - values to insert
s - add spaces
Returns:
true if everything went alright

finish

public void finish()
            throws IOException
Finishes file input.

Throws:
IOException - I/O exception

pos

public int pos()
Returns the current file position.

Returns:
file position

length

public long length()
Returns the file length.

Returns:
file position