public class EmptyBody extends AbstractBody
chunks, observers| Constructor and Description |
|---|
EmptyBody() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getContent()
Returns the body's content as a byte[] represenatation.
|
int |
getLength()
Warning: Calling this method will trigger reading the body from the client, disabling "streaming".
|
protected byte[] |
getRawLocal() |
boolean |
isRead() |
protected void |
readLocal() |
void |
write(AbstractBodyTransferrer out) |
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.
|
discard, getContentAsStream, getObservers, getRaw, hasRelevantObservers, markAsRead, read, setWasStreamed, toString, wasStreamedpublic int getLength()
AbstractBodyAbstractBody.isRead() to determine wether the body already has been read, if necessary.getLength in class AbstractBodyAbstractBody.getContent()public byte[] getContent()
AbstractBodyAbstractBody.getContent() might return a byte representation of
Wikipedia in chunks.The return value does not differ whether "Transfer-Encoding: chunked" is used or not (see http://en.wikipedia.org/wiki/Chunked_transfer_encoding ), the example above is taken from there. Please note that a new array is allocated when calling
AbstractBody.getContent(). If you do not need the body as one single byte[],
you should therefore use AbstractBody.getContentAsStream() instead.getContent in class AbstractBodyprotected void readLocal()
throws IOException
readLocal 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 AbstractBodyIOExceptionpublic void write(AbstractBodyTransferrer out) throws IOException
write in class AbstractBodyIOExceptionpublic boolean isRead()
isRead in class AbstractBodyCopyright © 2019. All Rights Reserved.