Package io.zeebe.test.util.io
Class ShortReadInputStream
- java.lang.Object
-
- java.io.InputStream
-
- io.zeebe.test.util.io.ShortReadInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class ShortReadInputStream extends InputStream
Only reads the firstbytesToReadbytes from the underlying input stream. After that it returns on every readEND_OF_STREAMifthrowExceptionis false, or anIOExceptionotherwise.
-
-
Field Summary
Fields Modifier and Type Field Description static intEND_OF_STREAM
-
Constructor Summary
Constructors Constructor Description ShortReadInputStream(InputStream underlyingInputStream, long bytesToRead, boolean throwException)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intread()-
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Field Detail
-
END_OF_STREAM
public static final int END_OF_STREAM
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ShortReadInputStream
public ShortReadInputStream(InputStream underlyingInputStream, long bytesToRead, boolean throwException)
-
-
Method Detail
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
-