|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Reader org.apache.commons.io.input.CharSequenceReader
public class CharSequenceReader
Reader
implementation that can read from String, StringBuffer,
StringBuilder or CharBuffer.
Note: Supports mark(int)
and reset()
.
Field Summary |
---|
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
CharSequenceReader(CharSequence charSequence)
Construct a new instance with the specified character sequence. |
Method Summary | |
---|---|
void |
close()
Close resets the file back to the start and removes any marked position. |
void |
mark(int readAheadLimit)
Mark the current position. |
boolean |
markSupported()
Mark is supported (returns true). |
int |
read()
Read a single character. |
int |
read(char[] array,
int offset,
int length)
Read the sepcified number of characters into the array. |
void |
reset()
Reset the reader to the last marked position (or the beginning if mark has not been called). |
long |
skip(long n)
Skip the specified number of characters. |
String |
toString()
Return a String representation of the underlying character sequence. |
Methods inherited from class java.io.Reader |
---|
read, read, ready |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CharSequenceReader(CharSequence charSequence)
charSequence
- The character sequence, may be null
Method Detail |
---|
public void close()
close
in interface Closeable
close
in class Reader
public void mark(int readAheadLimit)
mark
in class Reader
readAheadLimit
- ignoredpublic boolean markSupported()
markSupported
in class Reader
true
public int read()
read
in class Reader
public int read(char[] array, int offset, int length)
read
in class Reader
array
- The array to store the characters inoffset
- The starting position in the array to storelength
- The maximum number of characters to read
public void reset()
reset
in class Reader
public long skip(long n)
skip
in class Reader
n
- The number of characters to skip
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |