There are three distinct types of entities in HttpCore,
depending on where their content originates:
connection.
Streamed entities are generally not
repeatable.
repeatable.
This distinction is important for connection management with incoming entities. For entities that are created by an application and only sent using the HTTP components framework, the difference between streamed and self-contained is of little importance. In that case, it is suggested to consider non-repeatable entities as streamed, and those that are repeatable (without a huge effort) as self-contained.
| Modifier and Type | Method and Description |
|---|---|
| public InputStream | |
| public Supplier | |
| public boolean | Returns: true if the entity is repeatable, false otherwise.Tells if the entity is capable of producing its data more than once. |
| public boolean | Returns: true if the entity content is streamed,
false otherwiseTells whether this entity depends on an underlying stream. |
| public void | writeTo(OutputStream
the output stream to write entity content to outStream)Writes the entity content out to the output stream. |
| getContent | back to summary |
|---|---|
| public InputStream getContent() throws IOException, UnsupportedOperationException Returns a content stream of the entity.
If this entity belongs to an incoming HTTP message, calling
Important Note Please note all entity implementations must ensure that
all allocated resources are properly deallocated after
the
| |
| getTrailers | back to summary |
|---|---|
| public Supplier Returns supplier of message trailers - headers sent after message body.
May return
| |
| isRepeatable | back to summary |
|---|---|
| public boolean isRepeatable() 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() 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(OutputStream outStream) throws IOException Writes the entity content out to the output stream. Important Note Please note all entity implementations must ensure that all allocated resources are properly deallocated when this method returns.
| |