public class SimpleHttpEntity extends Object implements HttpEntity
The bytes are supplied to the constructor, as the body of the entity.
This is a sharable entity.
Constructor and Description |
---|
SimpleHttpEntity(ContentType contentType,
Stream<ByteBuffer> bytes)
Create an HttpEntity with `bytes` as the body.
|
SimpleHttpEntity(ContentType contentType,
ByteBuffer bytes)
Create an HttpEntity with `bytes` as the body.
|
SimpleHttpEntity(ContentType contentType,
byte[] bytes)
Create an HttpEntity with `bytes` as the body.
|
Instance Methods | |
---|---|
ByteSource |
body()
The body of this entity.
|
ContentType |
contentType()
The content type.
|
Long |
contentLength()
The length of the body.
|
Instant |
lastModified()
When this entity was last modified.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bodyBytes, bodyString, contentEncoding, etag, etagIsWeak, expires
public SimpleHttpEntity(ContentType contentType, Stream<ByteBuffer> bytes)
public SimpleHttpEntity(ContentType contentType, ByteBuffer bytes)
public SimpleHttpEntity(ContentType contentType, byte[] bytes)
public ByteSource body()
body
in interface HttpEntity
public ContentType contentType()
contentType
in interface HttpEntity
public Long contentLength()
contentLength
in interface HttpEntity
public Instant lastModified()
This implementation returns the time this object was instantiated.
lastModified
in interface HttpEntity