public static class Derby2017LayerATest.FailingReader
extends java.io.Reader
Reader thrown an exception when a certain amount of characters has been returned (or is about to be returned).
| Modifier and Type | Field and Description |
|---|---|
private long |
failAtPos |
private LoopingAlphabetReader |
in |
private long |
pos |
| Constructor and Description |
|---|
FailingReader(long length,
long failAtPos)
Creates a new failing reader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
read() |
int |
read(char[] cbuf,
int off,
int len) |
private final LoopingAlphabetReader in
private final long failAtPos
private long pos
public FailingReader(long length,
long failAtPos)
length - the total length of the sourcefailAtPos - the position to fail at (specifying zero or a
negative value causes an exception on the first read request)public int read()
throws java.io.IOException
read in class java.io.Readerjava.io.IOExceptionpublic int read(char[] cbuf,
int off,
int len)
throws java.io.IOException
read in class java.io.Readerjava.io.IOExceptionpublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.ReaderApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.