Package io.helidon.media.common
Class DataChunkInputStream
- java.lang.Object
-
- java.io.InputStream
-
- io.helidon.media.common.DataChunkInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class DataChunkInputStream extends InputStream
Provides a bridge between a reactiveFlow.Publisher
in Helidon and anInputStream
in Jersey. It subscribes to a Helidon publisher of data chunks and makes the data available to Jersey using the blockingInputStream
API. This implementation is documented here/docs-internal/datachunkinputstream.md
.
-
-
Constructor Summary
Constructors Constructor Description DataChunkInputStream(Flow.Publisher<DataChunk> originalPublisher)
Stores publisher for later subscription.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
int
read()
int
read(byte[] buf, int off, int len)
-
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
DataChunkInputStream
public DataChunkInputStream(Flow.Publisher<DataChunk> originalPublisher)
Stores publisher for later subscription.- Parameters:
originalPublisher
- The original publisher.
-
-
Method Detail
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] buf, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
-