org.compass.core.util.reader
Class ReverseStringReader
java.lang.Object
java.io.Reader
org.compass.core.util.reader.ReverseStringReader
- All Implemented Interfaces:
- Closeable, Readable, RepeatableReader
public class ReverseStringReader
- extends Reader
- implements RepeatableReader
A character stream whose source is a string. reverses the string. Allows for
repeatable reads from the same string.
Note, this is an unsafe reader in terms of IndexOutOfBoundsException.
- Author:
- kimchy
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReverseStringReader
public ReverseStringReader(String s)
read
public int read()
throws IOException
- Overrides:
read in class Reader
- Throws:
IOException
read
public int read(char[] cbuf,
int off,
int len)
throws IOException
- Specified by:
read in class Reader
- Throws:
IOException
skip
public long skip(long ns)
throws IOException
- Overrides:
skip in class Reader
- Throws:
IOException
ready
public boolean ready()
throws IOException
- Overrides:
ready in class Reader
- Throws:
IOException
markSupported
public boolean markSupported()
- Overrides:
markSupported in class Reader
mark
public void mark(int readAheadLimit)
throws IOException
- Overrides:
mark in class Reader
- Throws:
IOException
reset
public void reset()
throws IOException
- Overrides:
reset in class Reader
- Throws:
IOException
close
public void close()
- Specified by:
close in interface Closeable- Specified by:
close in class Reader
Copyright (c) 2004-2008 The Compass Project.