Package io.bdeploy.common.util
Class FixedLengthStream
java.lang.Object
java.io.InputStream
io.bdeploy.common.util.FixedLengthStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An input stream that reads a given amount of bytes from a stream.
-
Constructor Summary
ConstructorsConstructorDescriptionFixedLengthStream(InputStream in, long totalSize) Creates a new input stream that reads the given amount from the given stream. -
Method Summary
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
FixedLengthStream
Creates a new input stream that reads the given amount from the given stream.- Parameters:
in- the stream to read fromtotalSize- the number of bytes to read
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-