|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.simpleframework.http.message.UpdateConsumer
public abstract class UpdateConsumer
The UpdateConsumer object is used to create a consumer
that is used to consume and process large bodies. Typically a large
body will be one that is delivered as part of a multipart upload
or as a large form POST. The task of the large consumer is to
consume all the bytes for the body, and reset the cursor after the
last byte that has been send with the body. This ensures that the
next character read from the cursor is the first character of a
HTTP header within the pipeline.
| Field Summary | |
|---|---|
protected byte[] |
array
This is an external array used to copy data between buffers. |
protected boolean |
finished
This is used to determine whether the consumer has finished. |
| Constructor Summary | |
|---|---|
protected |
UpdateConsumer()
Constructor for the UpdateConsumer object. |
protected |
UpdateConsumer(int chunk)
Constructor for the UpdateConsumer object. |
| Method Summary | |
|---|---|
protected void |
commit(ByteCursor cursor)
This method can be used to commit the consumer when all data has been consumed. |
void |
consume(ByteCursor cursor)
This method is used to consume bytes from the provided cursor. |
boolean |
isFinished()
This is used to determine whether the consumer has finished reading. |
protected abstract int |
update(byte[] array,
int off,
int count)
This is used to process the bytes that have been read from the cursor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.simpleframework.http.message.BodyConsumer |
|---|
getBody |
| Field Detail |
|---|
protected byte[] array
protected boolean finished
| Constructor Detail |
|---|
protected UpdateConsumer()
UpdateConsumer object. This is
used to create a consumer with a one kilobyte buffer used to
read the contents from the cursor and transfer it to the buffer.
protected UpdateConsumer(int chunk)
UpdateConsumer object. This is
used to create a consumer with a variable size buffer used to
read the contents from the cursor and transfer it to the buffer.
chunk - this is the size of the buffer used to read bytes| Method Detail |
|---|
public boolean isFinished()
isFinished in interface ByteConsumer
public void consume(ByteCursor cursor)
throws IOException
ByteCursor object should be
read. If there are no ready bytes then this will return.
consume in interface ByteConsumercursor - used to consume the bytes from the HTTP pipeline
IOException
protected void commit(ByteCursor cursor)
throws IOException
cursor - this is the cursor used by this consumer
IOException
protected abstract int update(byte[] array,
int off,
int count)
throws IOException
array - this is a chunk read from the cursoroff - this is the offset within the array the chunk startscount - this is the number of bytes within the array
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||