xml
Class CharSequenceReader

java.lang.Object
  extended by java.io.Reader
      extended by xml.CharSequenceReader
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable

public class CharSequenceReader
extends java.io.Reader

implement a Reader on top of CharSequence, not only String like java.io.StringReader. mark() and reset() are not implemented but could be implemented, since the whole contents are accessible all the time. This class is not thread safe : concurrent reads could get twice the same data or hit exceptions when going after the end of the source sequence


Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
CharSequenceReader(java.lang.CharSequence src)
           
 
Method Summary
 void close()
           
 int read()
           
 int read(char[] buff, int off, int len)
           
 boolean ready()
           
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CharSequenceReader

public CharSequenceReader(java.lang.CharSequence src)
Parameters:
src - the source of characters to be read
Method Detail

read

public int read()
Overrides:
read in class java.io.Reader

read

public int read(char[] buff,
                int off,
                int len)
         throws java.io.IOException
Specified by:
read in class java.io.Reader
Throws:
java.io.IOException

ready

public boolean ready()
Overrides:
ready in class java.io.Reader

close

public void close()
Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Reader