Package software.amazon.awssdk.testutils
Class UnreliableRandomInputStream
- java.lang.Object
-
- java.io.InputStream
-
- software.amazon.awssdk.testutils.RandomInputStream
-
- software.amazon.awssdk.testutils.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.
-
-
Field Summary
-
Fields inherited from class software.amazon.awssdk.testutils.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 intread()intread(byte[] b, int off, int len)-
Methods inherited from class software.amazon.awssdk.testutils.RandomInputStream
getBytesRead
-
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, reset, skip
-
-
-
-
Method Detail
-
read
public int read() throws IOException- Overrides:
readin classRandomInputStream- Throws:
IOException- See Also:
RandomInputStream.read()
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classRandomInputStream- Throws:
IOException
-
-