public class UnreliableRandomInputStream extends RandomInputStream
Modifier and Type | Field and Description |
---|---|
private static boolean |
DEBUG |
private boolean |
hasTriggeredAnException
True if this stream has already triggered an exception
|
lengthInBytes, remainingBytes
Constructor and Description |
---|
UnreliableRandomInputStream(long lengthInBytes)
Constructs a new unreliable random data input stream of the specified
number of bytes.
|
Modifier and Type | Method and Description |
---|---|
int |
read() |
int |
read(byte[] b,
int off,
int len) |
private void |
triggerException() |
getBytesRead
private static final boolean DEBUG
private boolean hasTriggeredAnException
public UnreliableRandomInputStream(long lengthInBytes)
lengthInBytes
- The number of bytes of data contained in the new stream.public int read() throws java.io.IOException
read
in class RandomInputStream
java.io.IOException
com.amazonaws.util.RandomInputStream#read()
private void triggerException() throws java.io.IOException
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class RandomInputStream
java.io.IOException