org.bounce.text
Class DocumentInputReader
java.lang.Object
java.io.Reader
org.bounce.text.DocumentInputReader
- All Implemented Interfaces:
- Closeable, Readable
public class DocumentInputReader
- extends Reader
A Reader for XML input, which can handle escape characters.
Note: The XML Editor package is based on the JavaEditorKit example as
described in the article 'Customizing a Text Editor' by Timothy
Prinzing . See:
http://java.sun.com/products/jfc/tsc/articles/text/editor_kit/
- Version:
- $Revision: 1.4 $, $Date: 2008/01/28 21:02:14 $
- Author:
- Edwin Dankert
Method Summary |
void |
close()
|
int |
getLastChar()
Returns the last read character. |
int |
read()
Reads one character from the stream and increases the index. |
int |
read(char[] ac,
int i,
int j)
|
void |
setRange(int start,
int end)
Sets the scan range of the reader. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pos
public long pos
DocumentInputReader
public DocumentInputReader(Document document)
- Constructs the new input stream reader out of the Xml input strem.
- Parameters:
inputstream
- the XML input stream.
- Throws:
UnsupportedEncodingException
UnsupportedEncodingException
setRange
public void setRange(int start,
int end)
throws IOException
- Sets the scan range of the reader.
- Parameters:
start
- the start position.end
- the end position.
- Throws:
IOException
read
public int read()
throws IOException
- Reads one character from the stream and increases the index.
- Overrides:
read
in class Reader
- Returns:
- the character or -1 for an eof.
- Throws:
IOException
getLastChar
public int getLastChar()
- Returns the last read character.
- Returns:
- the last read character or -1 for an eof.
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Specified by:
close
in class Reader
- Throws:
IOException
read
public int read(char[] ac,
int i,
int j)
throws IOException
- Specified by:
read
in class Reader
- Throws:
IOException
Copyright © 2002-2011 Edwin Dankert. All Rights Reserved.