Package io.micronaut.http.body.stream
Class PublisherAsStream
java.lang.Object
java.io.InputStream
io.micronaut.http.body.stream.PublisherAsStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Transform a
PublisherAsBlocking
of buffers into a InputStream
.- Since:
- 4.10.0
- Author:
- Jonas Konrad
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
PublisherAsStream
-
-
Method Details
-
read
- Throws:
IOException
-
readSome
Read some data into a new byte array. The array may be of any size. This is usually the same as allocating a new array, callingInputStream.read(byte[])
, and then truncating the array, but may be optimized in some implementations.- Throws:
IOException
-
allowDiscard
public void allowDiscard()Allow discarding the input of this stream. SeeByteBody.allowDiscard()
. -
cancelInput
public void cancelInput()Cancel any further upstream input. This also removes any backpressure that this stream may apply on its upstream. -
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
-