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.Reader
java.io.IOException
public int read(char[] cbuf, int off, int len) throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Reader
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.