Package com.amazonaws.test.util
Class UnreliableRandomInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.amazonaws.test.util.RandomInputStream
-
- com.amazonaws.test.util.UnreliableRandomInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class UnreliableRandomInputStream extends RandomInputStream
Subclass of RandomInputStream that, in addition to spitting out a set length of random characters, throws an IOException. Intended for testing error recovery in the client library.- Author:
- Jason Fulghum
-
-
Field Summary
-
Fields inherited from class com.amazonaws.test.util.RandomInputStream
lengthInBytes, remainingBytes
-
-
Constructor Summary
Constructors Constructor Description UnreliableRandomInputStream(long lengthInBytes)
Constructs a new unreliable random data input stream of the specified number of bytes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
read()
int
read(byte[] b, int off, int len)
-
Methods inherited from class com.amazonaws.test.util.RandomInputStream
getBytesRead
-
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Method Detail
-
read
public int read() throws IOException
- Overrides:
read
in classRandomInputStream
- Throws:
IOException
- See Also:
com.amazonaws.util.RandomInputStream#read()
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classRandomInputStream
- Throws:
IOException
-
-