@NoExtend public class InputStreamHttpEntity extends Object implements HttpEntity
| Constructor and Description |
|---|
InputStreamHttpEntity(InputStream inputStream) |
InputStreamHttpEntity(InputStream inputStream,
Long contentLength) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBytes()
Provides the entity's content as bytes.
|
InputStream |
getContent()
Provides the entity's content as a stream.
|
Optional<Long> |
getLength()
Provides the length (in bytes) of the
HttpEntity, if known. |
Collection<HttpPart> |
getParts()
Provides the entity's content parts.
|
boolean |
isComposed()
Tells whether or not this entity is composed of several parts, in which case they should be available through
HttpEntity.getParts(). |
boolean |
isStreaming()
Tells whether this entity's content is stream based.
|
public InputStreamHttpEntity(InputStream inputStream)
public InputStreamHttpEntity(InputStream inputStream, Long contentLength)
public boolean isStreaming()
HttpEntityisStreaming in interface HttpEntitytrue if content is streamed, false otherwiseHttpEntity.getContent()public boolean isComposed()
HttpEntityHttpEntity.getParts().isComposed in interface HttpEntitytrue if there are several content parts, false otherwisepublic InputStream getContent()
HttpEntitygetContent in interface HttpEntityInputStream representing this entity's content or null if such representation is not possiblepublic byte[] getBytes()
throws IOException
HttpEntitygetBytes in interface HttpEntitynull if such representation is not possibleIOException - if an error occurs creating the byte arraypublic Collection<HttpPart> getParts()
HttpEntitygetParts in interface HttpEntityHttpParts representing this entity's content parts, if presentHttpEntity.isComposed()public Optional<Long> getLength()
HttpEntityHttpEntity, if known. For the most part, only received entities from HTTP
messages that carried a 'Content-Length' header will return a length.getLength in interface HttpEntityOptional with the length (in bytes) or an empty one if unknownCopyright © 2003–2018 MuleSoft, Inc.. All rights reserved.