@NotThreadSafe public class InputStreamEntityHC4 extends AbstractHttpEntityHC4
InputStream.chunked, contentEncoding, contentType, OUTPUT_BUFFER_SIZE| Constructor and Description |
|---|
InputStreamEntityHC4(java.io.InputStream instream)
Creates an entity with an unknown length.
|
InputStreamEntityHC4(java.io.InputStream instream,
ContentType contentType)
Creates an entity with a content type and unknown length.
|
InputStreamEntityHC4(java.io.InputStream instream,
long length)
Creates an entity with a specified content length.
|
InputStreamEntityHC4(java.io.InputStream instream,
long length,
ContentType contentType) |
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
getContent() |
long |
getContentLength() |
boolean |
isRepeatable() |
boolean |
isStreaming() |
void |
writeTo(java.io.OutputStream outstream)
Writes bytes from the
InputStream this entity was constructed
with to an OutputStream. |
consumeContent, getContentEncoding, getContentType, isChunked, setChunked, setContentEncoding, setContentEncoding, setContentType, setContentTypepublic InputStreamEntityHC4(java.io.InputStream instream)
new InputStreamEntityHC4(instream, -1).instream - input streamjava.lang.IllegalArgumentException - if instream is nullpublic InputStreamEntityHC4(java.io.InputStream instream,
long length)
instream - input streamlength - of the input stream, -1 if unknownjava.lang.IllegalArgumentException - if instream is nullpublic InputStreamEntityHC4(java.io.InputStream instream,
ContentType contentType)
new InputStreamEntityHC4(instream, -1, contentType).instream - input streamcontentType - content typejava.lang.IllegalArgumentException - if instream is nullpublic InputStreamEntityHC4(java.io.InputStream instream,
long length,
ContentType contentType)
instream - input streamlength - of the input stream, -1 if unknowncontentType - for specifying the Content-Type header, may be nulljava.lang.IllegalArgumentException - if instream is nullpublic boolean isRepeatable()
public long getContentLength()
-1 if unknownpublic java.io.InputStream getContent()
throws java.io.IOException
java.io.IOExceptionpublic void writeTo(java.io.OutputStream outstream)
throws java.io.IOException
InputStream this entity was constructed
with to an OutputStream. The content length
determines how many bytes are written. If the length is unknown (-1), the
stream will be completely consumed (to the end of the stream).java.io.IOExceptionpublic boolean isStreaming()
Copyright © 1999-2015 The Apache Software Foundation. All rights reserved.