public class StopableReader extends FilterReader
stop
method of the
reader is called, all following read accesses will signal end of stream regardless of
the state of the underlying reader.in
Constructor and Description |
---|
StopableReader(Reader in)
Constructs a new StopableReader which will read from the passed in stream.
|
Modifier and Type | Method and Description |
---|---|
int |
getCharCount() |
int |
read()
Reads a single character from the stream.
|
int |
read(char[] cbuf,
int off,
int len)
Reads an array of bytes from the stream.
|
void |
stop()
Makes this reader signal end of file on all following reads.
|
close, mark, markSupported, ready, reset, skip
public StopableReader(Reader in)
in
- The reader to which read requests will be forwarded.public int read() throws IOException
stop
method of this reader
was called, this method will return -1 to signal end of stream.read
in class FilterReader
IOException
- if the read has failed.public int read(char[] cbuf, int off, int len) throws IOException
stop
method of this reader
was called, the method will return -1 to signal end of stream.read
in class FilterReader
cbuf
- Buffer where the read characters will be stored.off
- Offset into the buffer.len
- Number of characters to read.IOException
- if the read has failed.public void stop()
public int getCharCount()
Copyright © 2001-2013 the JGloss developers. All Rights Reserved.