public class BrokenReader extends Reader
IOException from
all the Reader methods where the exception is declared.
This class is mostly useful for testing error handling in code that uses a reader.
| Constructor and Description |
|---|
BrokenReader()
Creates a new reader that always throws an
IOException |
BrokenReader(IOException exception)
Creates a new reader that always throws the given exception.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Throws the configured exception.
|
void |
mark(int readAheadLimit)
Throws the configured exception.
|
int |
read(char[] cbuf,
int off,
int len)
Throws the configured exception.
|
boolean |
ready()
Throws the configured exception.
|
void |
reset()
Throws the configured exception.
|
long |
skip(long n)
Throws the configured exception.
|
markSupported, read, read, readpublic BrokenReader(IOException exception)
exception - the exception to be thrownpublic BrokenReader()
IOExceptionpublic int read(char[] cbuf,
int off,
int len)
throws IOException
read in class Readercbuf - ignoredoff - ignoredlen - ignoredIOException - always thrownpublic long skip(long n)
throws IOException
skip in class Readern - ignoredIOException - always thrownpublic boolean ready()
throws IOException
ready in class ReaderIOException - always thrownpublic void mark(int readAheadLimit)
throws IOException
mark in class ReaderreadAheadLimit - ignoredIOException - always thrownpublic void reset()
throws IOException
reset in class ReaderIOException - always thrownpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class ReaderIOException - always thrownCopyright © 2002–2021 The Apache Software Foundation. All rights reserved.