public class InputStreamEntity
extends org.apache.http.entity.AbstractHttpEntity
InputStream.
Copied from HttpClient source in order to increase buffer size.| Modifier and Type | Field and Description |
|---|---|
protected static int |
OUTPUT_BUFFER_SIZE |
| Constructor and Description |
|---|
InputStreamEntity(InputStream instream)
Creates an entity with an unknown length.
|
InputStreamEntity(InputStream instream,
org.apache.http.entity.ContentType contentType)
Creates an entity with a content type and unknown length.
|
InputStreamEntity(InputStream instream,
long length)
Creates an entity with a specified content length.
|
InputStreamEntity(InputStream instream,
long length,
org.apache.http.entity.ContentType contentType) |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
getContent() |
long |
getContentLength() |
boolean |
isRepeatable() |
boolean |
isStreaming() |
void |
writeTo(OutputStream outstream)
Writes bytes from the
InputStream this entity was constructed
with to an OutputStream. |
protected static final int OUTPUT_BUFFER_SIZE
public InputStreamEntity(InputStream instream)
new InputStreamEntity(instream, -1).instream - input streamIllegalArgumentException - if instream is nullpublic InputStreamEntity(InputStream instream, long length)
instream - input streamlength - of the input stream, -1 if unknownIllegalArgumentException - if instream is nullpublic InputStreamEntity(InputStream instream, org.apache.http.entity.ContentType contentType)
new InputStreamEntity(instream, -1, contentType).instream - input streamcontentType - content typeIllegalArgumentException - if instream is nullpublic InputStreamEntity(InputStream instream, long length, org.apache.http.entity.ContentType contentType)
instream - input streamlength - of the input stream, -1 if unknowncontentType - for specifying the Content-Type header, may be nullIllegalArgumentException - if instream is nullpublic boolean isRepeatable()
public long getContentLength()
-1 if unknownpublic InputStream getContent() throws IOException
IOExceptionpublic void writeTo(OutputStream outstream) throws 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).IOExceptionpublic boolean isStreaming()
Copyright © 2022 The Apache Software Foundation. All rights reserved.