public interface ByteConsumer
ByteConsumer
object is used to consume and process
bytes from a cursor. This is used to consume bytes from a pipeline
and process the content in order to produce a valid HTTP message.
Using a consumer allows the server to gather and process the data
from the stream bit by bit without blocking.
A consumer has completed its task when it has either exhausted its
stream, or when it has consume a terminal token. For instance a
consumer for a HTTP header will have two CRLF
bytes
tokens to identify the end of the header, once this has been read
any excess bytes are reset on the cursor and it has finished.
ByteCursor
Modifier and Type | Method and Description |
---|---|
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.
|
void consume(ByteCursor cursor) throws IOException
ByteCursor
object should be
read. If there are no ready bytes then this method return.cursor
- used to consume the bytes from the cursorIOException
boolean isFinished()
Copyright © 2023. All rights reserved.