Package org.exoplatform.portal.resource
Class CharSequenceReader
java.lang.Object
java.io.Reader
org.exoplatform.portal.resource.CharSequenceReader
- All Implemented Interfaces:
Closeable,Serializable,AutoCloseable,Readable
Fork of commons-io 1.4 org.apache.commons.io.input.CharSequenceReader
Reader implementation that can read from String, StringBuffer, StringBuilder or CharBuffer.
- Since:
- Commons IO 1.4
- Version:
- $Revision$ $Date$
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCharSequenceReader(CharSequence charSequence) Construct a new instance with the specified character sequence. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close resets the file back to the start and removes any marked position.voidmark(int readAheadLimit) Mark the current position.booleanMark is supported (returns true).intread()Read a single character.intread(char[] array, int offset, int length) Read the sepcified number of characters into the array.voidreset()Reset the reader to the last marked position (or the beginning if mark has not been called).longskip(long n) Skip the specified number of characters.toString()Return a String representation of the underlying character sequence.Methods inherited from class java.io.Reader
nullReader, read, read, ready, transferTo
-
Constructor Details
-
CharSequenceReader
Construct a new instance with the specified character sequence.- Parameters:
charSequence- The character sequence, may benull
-
-
Method Details
-
close
public void close()Close resets the file back to the start and removes any marked position. -
mark
public void mark(int readAheadLimit) Mark the current position. -
markSupported
public boolean markSupported()Mark is supported (returns true).- Overrides:
markSupportedin classReader- Returns:
true
-
read
public int read()Read a single character. -
read
public int read(char[] array, int offset, int length) Read the sepcified number of characters into the array. -
reset
public void reset()Reset the reader to the last marked position (or the beginning if mark has not been called). -
skip
public long skip(long n) Skip the specified number of characters. -
toString
Return a String representation of the underlying character sequence.
-