Package com.amazonaws.test.util
Class ConstantInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.amazonaws.internal.SdkInputStream
-
- com.amazonaws.test.util.ConstantInputStream
-
- All Implemented Interfaces:
com.amazonaws.internal.MetricAware,com.amazonaws.internal.Releasable,Closeable,AutoCloseable
public class ConstantInputStream extends com.amazonaws.internal.SdkInputStreamA test input stream that always return the same value.
-
-
Constructor Summary
Constructors Constructor Description ConstantInputStream(long total, byte val)ConstantInputStream(long total, byte val, boolean randomlyReturnZeros)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetRandomZerosCount()protected InputStreamgetWrappedInputStream()Returns the underlying input stream, if any, from the subclass; or null if there is no underlying input stream.intread()intread(byte[] b, int off, int len)-
Methods inherited from class com.amazonaws.internal.SdkInputStream
abort, abortIfNeeded, isMetricActivated, release
-
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(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
getRandomZerosCount
public int getRandomZerosCount()
-
getWrappedInputStream
protected InputStream getWrappedInputStream()
Description copied from class:com.amazonaws.internal.SdkInputStreamReturns the underlying input stream, if any, from the subclass; or null if there is no underlying input stream.- Specified by:
getWrappedInputStreamin classcom.amazonaws.internal.SdkInputStream
-
-