public class Body extends AbstractBody
ChunkedBody instead, if
"Transfer-Encoding: chunked" is set on the input.
The "Transfer-Encoding" of the output is not determined by this class hierarchy, but by
AbstractBodyTransferrer and its subclasses.
The caller is responsible to adjust the header accordingly,
e.g. the fields Transfer-Encoding and Content-Length.chunks, observers| Constructor and Description |
|---|
Body(byte[] content) |
Body(InputStream in) |
Body(InputStream in,
long length) |
| Modifier and Type | Method and Description |
|---|---|
void |
discard() |
protected byte[] |
getRawLocal() |
protected void |
readLocal() |
protected void |
writeAlreadyRead(AbstractBodyTransferrer out) |
protected void |
writeNotRead(AbstractBodyTransferrer out) |
protected void |
writeStreamed(AbstractBodyTransferrer out)
Is called when there are no observers that need to read the body.
|
getContent, getContentAsStream, getLength, getObservers, getRaw, hasRelevantObservers, isRead, markAsRead, read, setWasStreamed, toString, wasStreamed, writepublic Body(InputStream in) throws IOException
IOExceptionpublic Body(InputStream in, long length) throws IOException
IOExceptionpublic Body(byte[] content)
protected void readLocal()
throws IOException
readLocal in class AbstractBodyIOExceptionpublic void discard()
throws IOException
discard in class AbstractBodyIOExceptionprotected void writeAlreadyRead(AbstractBodyTransferrer out) throws IOException
writeAlreadyRead in class AbstractBodyIOExceptionprotected void writeNotRead(AbstractBodyTransferrer out) throws IOException
writeNotRead in class AbstractBodyIOExceptionprotected void writeStreamed(AbstractBodyTransferrer out) throws IOException
AbstractBodywriteStreamed in class AbstractBodyIOExceptionprotected byte[] getRawLocal()
throws IOException
getRawLocal in class AbstractBodyIOExceptionCopyright © 2022. All Rights Reserved.