public class RepeatableInputStreamEntity extends CloseableInputStreamEntity
CloseableInputStreamEntity that can be read via getContent() or writeTo(OutputStream)
multiple times.| Constructor and Description |
|---|
RepeatableInputStreamEntity(InputStream input,
long length,
org.apache.http.entity.ContentType contentType)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
getContent()
The input stream will be reset prior to being returned
|
boolean |
isRepeatable()
Always returns true
|
void |
writeTo(OutputStream outstream)
The input stream will be closed prior to being written to the provided
OutputStream |
closeconsumeContent, getContentEncoding, getContentType, isChunked, setChunked, setContentEncoding, setContentEncoding, setContentType, setContentType, toStringpublic RepeatableInputStreamEntity(InputStream input, long length, org.apache.http.entity.ContentType contentType)
InputStream.reset() will position the stream at the position it was in when passed to this
constructor.input - the input stream (required to support mark/rest)length - the length of the input streamcontentType - the content type of the input streampublic boolean isRepeatable()
isRepeatable in interface org.apache.http.HttpEntityisRepeatable in class org.apache.http.entity.InputStreamEntitypublic InputStream getContent() throws IOException
getContent in interface org.apache.http.HttpEntitygetContent in class org.apache.http.entity.InputStreamEntityIOExceptionpublic void writeTo(OutputStream outstream) throws IOException
OutputStreamwriteTo in interface org.apache.http.HttpEntitywriteTo in class org.apache.http.entity.InputStreamEntityIOException