InputStream.
| Modifier and Type | Field and Description |
|---|---|
| private final InputStream | |
| private final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | InputStreamEntity(final InputStream
input stream inStream, final long of the input stream, length)-1 if unknownCreates an entity with a specified content length. |
| public | InputStreamEntity(final InputStream
input stream inStream, final ContentType content type contentType)Creates an entity with a content type and unknown length. |
| public | InputStreamEntity(final InputStream
input stream inStream, final long of the input stream, length, final ContentType -1 if unknownfor specifying the contentType)Content-Type header, may be null
|
| Modifier and Type | Method and Description |
|---|---|
| public InputStream | getContent()
Implements org. |
| public long | Returns: the content length or-1 if unknownImplements org. |
| public boolean | isRepeatable()
Implements org. |
| public boolean | isStreaming()
Implements org. |
| public void | writeTo(final OutputStream
the output stream to write entity content to outStream)Implements org. InputStream this entity was constructed
with to an OutputStream.
|
| content | back to summary |
|---|---|
| private final InputStream content | |
| length | back to summary |
|---|---|
| private final long length | |
| InputStreamEntity | back to summary |
|---|---|
| public InputStreamEntity(final InputStream inStream) Creates an entity with an unknown length.
Equivalent to
| |
| InputStreamEntity | back to summary |
|---|---|
| public InputStreamEntity(final InputStream inStream, final long length) Creates an entity with a specified content length.
| |
| InputStreamEntity | back to summary |
|---|---|
| public InputStreamEntity(final InputStream inStream, final ContentType contentType) Creates an entity with a content type and unknown length.
Equivalent to
| |
| InputStreamEntity | back to summary |
|---|---|
public InputStreamEntity(final InputStream inStream, final long length, final ContentType contentType)
| |
| getContent | back to summary |
|---|---|
| public InputStream getContent() throws IOException Implements org. Doc from org. Returns a content stream of the entity.
Important Note Please note all entity implementations must ensure that
all allocated resources are properly deallocated after
the
| |
| getContentLength | back to summary |
|---|---|
| public long getContentLength() Implements org. Doc from org. Tells the length of the content, if known.
| |
| isRepeatable | back to summary |
|---|---|
| public boolean isRepeatable() Implements org. Doc from org. Tells if the entity is capable of producing its data more than once. A repeatable entity's getContent() and writeTo(OutputStream) methods can be called more than once whereas a non-repeatable entity's can not.
| |
| isStreaming | back to summary |
|---|---|
| public boolean isStreaming() Implements org. Doc from org. Tells whether this entity depends on an underlying stream.
Streamed entities that read data directly from the socket should
return
| |
| writeTo | back to summary |
|---|---|
| public void writeTo(final OutputStream outStream) throws IOException Implements org. Writes bytes from the
| |