public interface InputReader extends Closeable, AutoCloseable
For safe usage in InputReaderTask
implementation of this
interface has to be responsive to interruption.
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the reader releasing the resources held by it.
|
int |
readInput(InputProcessor processor)
Reads some input and process it through the processor (if any).
|
int readInput(@NullAllowed InputProcessor processor) throws IOException
Implementation of this method has to be non blocking
for safe usage in InputReaderTask
.
processor
- consumer of read characters, may be null
IOException
- if any read or process error occursvoid close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
- if error occurs while closing