public final class MultiPartMIMEInputStream extends java.lang.Object implements MultiPartMIMEDataSourceWriter
InputStream to function as a data source to for a
MultiPartMIMEWriter. This class uses the provided
ExecutorService to perform blocking reads and respond to write requests
asynchronously.
This class will close the underlying input stream when either of these events happen:
1. The stream is finished being read.
2. There was an exception reading the stream, at which point the stream is closed and error() is called on the write
handle.
3. The writer was aborted.| Modifier and Type | Class and Description |
|---|---|
static class |
MultiPartMIMEInputStream.Builder
Builder to create a new instance of a MultiPartMIMEInputStream that wraps the provided InputStream.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_ABORT_INPUT_STREAM_TIMEOUT |
static int |
DEFAULT_MAXIMUM_BLOCKING_DURATION |
static int |
DEFAULT_WRITE_CHUNK_SIZE |
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.String> |
dataSourceHeaders()
Immediately return the headers need for this part.
|
void |
onAbort(java.lang.Throwable e) |
void |
onInit(com.linkedin.r2.message.stream.entitystream.WriteHandle wh) |
void |
onWritePossible() |
public static final int DEFAULT_MAXIMUM_BLOCKING_DURATION
public static final int DEFAULT_WRITE_CHUNK_SIZE
public static final int DEFAULT_ABORT_INPUT_STREAM_TIMEOUT
public void onInit(com.linkedin.r2.message.stream.entitystream.WriteHandle wh)
onInit in interface com.linkedin.r2.message.stream.entitystream.Writerpublic void onWritePossible()
onWritePossible in interface com.linkedin.r2.message.stream.entitystream.Writerpublic void onAbort(java.lang.Throwable e)
onAbort in interface com.linkedin.r2.message.stream.entitystream.Writerpublic java.util.Map<java.lang.String,java.lang.String> dataSourceHeaders()
MultiPartMIMEDataSourceWriterdataSourceHeaders in interface MultiPartMIMEDataSourceWriter