Package org.jivesoftware.smack.util
Class ObservableReader
java.lang.Object
java.io.Reader
org.jivesoftware.smack.util.ObservableReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
An ObservableReader is a wrapper on a Reader that notifies to its listeners when
reading character streams.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addReaderListener
(ReaderListener readerListener) Adds a reader listener to this reader that will be notified when new strings are read.void
close()
void
mark
(int readAheadLimit) boolean
int
read()
int
read
(char[] cbuf) int
read
(char[] cbuf, int off, int len) boolean
ready()
void
removeReaderListener
(ReaderListener readerListener) Removes a reader listener from this reader.void
reset()
long
skip
(long n) Methods inherited from class java.io.Reader
nullReader, read, transferTo
-
Constructor Details
-
ObservableReader
-
-
Method Details
-
read
- Specified by:
read
in classReader
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classReader
- Throws:
IOException
-
read
- Overrides:
read
in classReader
- Throws:
IOException
-
read
- Overrides:
read
in classReader
- Throws:
IOException
-
skip
- Overrides:
skip
in classReader
- Throws:
IOException
-
ready
- Overrides:
ready
in classReader
- Throws:
IOException
-
markSupported
- Overrides:
markSupported
in classReader
-
mark
- Overrides:
mark
in classReader
- Throws:
IOException
-
reset
- Overrides:
reset
in classReader
- Throws:
IOException
-
addReaderListener
Adds a reader listener to this reader that will be notified when new strings are read.- Parameters:
readerListener
- a reader listener.
-
removeReaderListener
Removes a reader listener from this reader.- Parameters:
readerListener
- a reader listener.
-