public class BinaryEntity extends MimeEntity implements AutoCloseable, net.lecousin.framework.util.AsyncCloseable<IOException>
| Modifier and Type | Class and Description |
|---|---|
class |
BinaryEntity.Consumer
Consume data into an OutputToInput.
|
MimeEntity.Parser, MimeEntity.Transfer| Modifier and Type | Field and Description |
|---|---|
protected net.lecousin.framework.io.IO.Readable |
content |
headers, parent| Constructor and Description |
|---|
BinaryEntity(net.lecousin.framework.io.IO.Readable content)
Constructor.
|
BinaryEntity(MimeEntity parent,
MimeHeaders headers)
From existing headers.
|
BinaryEntity(MimeEntity parent,
ParameterizedHeaderValue contentType,
net.lecousin.framework.io.IO.Readable content)
Constructor.
|
BinaryEntity(ParameterizedHeaderValue contentType,
net.lecousin.framework.io.IO.Readable content)
Constructor.
|
BinaryEntity(String contentType,
net.lecousin.framework.io.IO.Readable content)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canProduceBodyRange()
Return true if this entity is able to extract a range of the body.
|
void |
close() |
net.lecousin.framework.concurrent.async.IAsync<IOException> |
closeAsync() |
net.lecousin.framework.concurrent.async.AsyncSupplier<net.lecousin.framework.util.Pair<Long,net.lecousin.framework.concurrent.util.AsyncProducer<ByteBuffer,IOException>>,IOException> |
createBodyProducer()
Create a producer of this entity's body.
|
net.lecousin.framework.util.Triple<net.lecousin.framework.math.RangeLong,Long,BinaryEntity> |
createBodyRange(net.lecousin.framework.math.RangeLong range)
Extract a range of this entity's body.
|
net.lecousin.framework.concurrent.util.AsyncConsumer<ByteBuffer,IOException> |
createConsumer(Long size)
Create a consumer of data to parse the body.
|
static BinaryEntity |
fromString(String content,
Charset charset,
String contentType)
Create a BinaryEntity with a Content-Type header and the body from the given string.
|
net.lecousin.framework.io.IO.Readable |
getContent() |
void |
setContent(net.lecousin.framework.io.IO.Readable content) |
void |
setContentType(ParameterizedHeaderValue contentType)
Set the Content-Type.
|
void |
setContentType(String contentType)
Set the Content-Type.
|
getHeaders, getParent, parse, writeEntitypublic BinaryEntity(ParameterizedHeaderValue contentType, net.lecousin.framework.io.IO.Readable content)
public BinaryEntity(String contentType, net.lecousin.framework.io.IO.Readable content)
public BinaryEntity(net.lecousin.framework.io.IO.Readable content)
public BinaryEntity(MimeEntity parent, ParameterizedHeaderValue contentType, net.lecousin.framework.io.IO.Readable content)
public BinaryEntity(MimeEntity parent, MimeHeaders headers)
public net.lecousin.framework.io.IO.Readable getContent()
public void setContent(net.lecousin.framework.io.IO.Readable content)
public void setContentType(ParameterizedHeaderValue contentType)
public void setContentType(String contentType)
public net.lecousin.framework.concurrent.async.AsyncSupplier<net.lecousin.framework.util.Pair<Long,net.lecousin.framework.concurrent.util.AsyncProducer<ByteBuffer,IOException>>,IOException> createBodyProducer()
MimeEntitycreateBodyProducer in class MimeEntitypublic boolean canProduceBodyRange()
MimeEntitycanProduceBodyRange in class MimeEntitypublic net.lecousin.framework.util.Triple<net.lecousin.framework.math.RangeLong,Long,BinaryEntity> createBodyRange(net.lecousin.framework.math.RangeLong range)
MimeEntitycreateBodyRange in class MimeEntitypublic net.lecousin.framework.concurrent.util.AsyncConsumer<ByteBuffer,IOException> createConsumer(Long size)
MimeEntitycreateConsumer in class MimeEntitysize - size of data to consume if known, null if unknownpublic net.lecousin.framework.concurrent.async.IAsync<IOException> closeAsync()
closeAsync in interface net.lecousin.framework.util.AsyncCloseable<IOException>public void close()
throws Exception
close in interface AutoCloseableExceptionpublic static BinaryEntity fromString(String content, Charset charset, String contentType)
Copyright © 2020. All rights reserved.