Package org.jivesoftware.smack.util
Class ObservableReader
- java.lang.Object
-
- java.io.Reader
-
- org.jivesoftware.smack.util.ObservableReader
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
public class ObservableReader extends Reader
An ObservableReader is a wrapper on a Reader that notifies to its listeners when reading character streams.
-
-
Constructor Summary
Constructors Constructor Description ObservableReader(Reader wrappedReader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddReaderListener(ReaderListener readerListener)Adds a reader listener to this reader that will be notified when new strings are read.voidclose()voidmark(int readAheadLimit)booleanmarkSupported()intread()intread(char[] cbuf)intread(char[] cbuf, int off, int len)booleanready()voidremoveReaderListener(ReaderListener readerListener)Removes a reader listener from this reader.voidreset()longskip(long n)-
Methods inherited from class java.io.Reader
nullReader, read, transferTo
-
-
-
-
Constructor Detail
-
ObservableReader
public ObservableReader(Reader wrappedReader)
-
-
Method Detail
-
read
public int read(char[] cbuf, int off, int len) throws IOException
- Specified by:
readin classReader- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-
read
public int read() throws IOException
- Overrides:
readin classReader- Throws:
IOException
-
read
public int read(char[] cbuf) throws IOException
- Overrides:
readin classReader- Throws:
IOException
-
skip
public long skip(long n) throws IOException
- Overrides:
skipin classReader- Throws:
IOException
-
ready
public boolean ready() throws IOException
- Overrides:
readyin classReader- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classReader
-
mark
public void mark(int readAheadLimit) throws IOException
- Overrides:
markin classReader- Throws:
IOException
-
reset
public void reset() throws IOException
- Overrides:
resetin classReader- Throws:
IOException
-
addReaderListener
public void addReaderListener(ReaderListener readerListener)
Adds a reader listener to this reader that will be notified when new strings are read.- Parameters:
readerListener- a reader listener.
-
removeReaderListener
public void removeReaderListener(ReaderListener readerListener)
Removes a reader listener from this reader.- Parameters:
readerListener- a reader listener.
-
-