| Modifier and Type | Class and Description |
|---|---|
static class |
HttpParser.EventHandler |
| Modifier and Type | Field and Description |
|---|---|
protected int |
_chunkLength |
protected int |
_chunkPosition |
protected long |
_contentLength |
protected long |
_contentPosition |
protected View |
_contentView |
protected byte |
_eol |
protected int |
_length |
protected int |
_state |
static int |
STATE_CHUNK |
static int |
STATE_CHUNK_PARAMS |
static int |
STATE_CHUNK_SIZE |
static int |
STATE_CHUNKED_CONTENT |
static int |
STATE_CONTENT |
static int |
STATE_END |
static int |
STATE_END0 |
static int |
STATE_END1 |
static int |
STATE_EOF_CONTENT |
static int |
STATE_FIELD0 |
static int |
STATE_FIELD2 |
static int |
STATE_HEADER |
static int |
STATE_HEADER_IN_NAME |
static int |
STATE_HEADER_IN_VALUE |
static int |
STATE_HEADER_NAME |
static int |
STATE_HEADER_VALUE |
static int |
STATE_SEEKING_EOF |
static int |
STATE_SPACE1 |
static int |
STATE_SPACE2 |
static int |
STATE_START |
static int |
STATE_STATUS |
static int |
STATE_URI |
| Constructor and Description |
|---|
HttpParser(Buffer buffer,
HttpParser.EventHandler handler)
Constructor.
|
HttpParser(Buffers buffers,
EndPoint endp,
HttpParser.EventHandler handler)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
Buffer |
blockForContent(long maxIdleTime) |
protected int |
fill()
fill the buffers from the endpoint
|
Buffer |
getBodyBuffer() |
long |
getContentLength() |
long |
getContentRead() |
Buffer |
getHeaderBuffer() |
int |
getState() |
boolean |
inContentState() |
boolean |
inHeaderState() |
boolean |
isChunking() |
boolean |
isComplete() |
boolean |
isIdle() |
boolean |
isMoreInBuffer() |
boolean |
isPersistent() |
boolean |
isState(int state) |
void |
parse()
Parse until
END state. |
boolean |
parseAvailable()
Parse until END state.
|
int |
parseNext()
Parse until next Event.
|
void |
reset() |
void |
returnBuffers() |
void |
setForceContentBuffer(boolean force) |
void |
setHeadResponse(boolean head)
Set if a HEAD response is expected
|
void |
setPersistent(boolean persistent) |
void |
setState(int state) |
java.lang.String |
toString() |
java.lang.String |
toString(Buffer buf) |
public static final int STATE_START
public static final int STATE_FIELD0
public static final int STATE_SPACE1
public static final int STATE_STATUS
public static final int STATE_URI
public static final int STATE_SPACE2
public static final int STATE_END0
public static final int STATE_END1
public static final int STATE_FIELD2
public static final int STATE_HEADER
public static final int STATE_HEADER_NAME
public static final int STATE_HEADER_IN_NAME
public static final int STATE_HEADER_VALUE
public static final int STATE_HEADER_IN_VALUE
public static final int STATE_END
public static final int STATE_EOF_CONTENT
public static final int STATE_CONTENT
public static final int STATE_CHUNKED_CONTENT
public static final int STATE_CHUNK_SIZE
public static final int STATE_CHUNK_PARAMS
public static final int STATE_CHUNK
public static final int STATE_SEEKING_EOF
protected final View _contentView
protected int _state
protected byte _eol
protected int _length
protected long _contentLength
protected long _contentPosition
protected int _chunkLength
protected int _chunkPosition
public HttpParser(Buffer buffer, HttpParser.EventHandler handler)
public HttpParser(Buffers buffers, EndPoint endp, HttpParser.EventHandler handler)
buffers - the buffers to useendp - the endpointhandler - the even handlerpublic long getContentLength()
public long getContentRead()
public void setHeadResponse(boolean head)
head - public int getState()
public boolean inContentState()
public boolean inHeaderState()
public boolean isChunking()
public boolean isComplete()
isComplete in interface Parserpublic boolean isMoreInBuffer()
throws java.io.IOException
isMoreInBuffer in interface Parserjava.io.IOExceptionpublic boolean isState(int state)
public boolean isPersistent()
isPersistent in interface Parserpublic void setPersistent(boolean persistent)
setPersistent in interface Parserpublic void parse()
throws java.io.IOException
java.lang.IllegalStateException - If the buffers have already been partially parsed.java.io.IOExceptionpublic boolean parseAvailable()
throws java.io.IOException
current state of the parser.parseAvailable in interface Parserjava.io.IOExceptionparse(),
parseNext()public int parseNext()
throws java.io.IOException
java.io.IOExceptionprotected int fill()
throws java.io.IOException
java.io.IOExceptionpublic void returnBuffers()
returnBuffers in interface Parserpublic void setState(int state)
public java.lang.String toString(Buffer buf)
public java.lang.String toString()
toString in class java.lang.Objectpublic Buffer getHeaderBuffer()
public Buffer getBodyBuffer()
public void setForceContentBuffer(boolean force)
force - True if a new buffer will be forced to be used for content and the header buffer will not be used.public Buffer blockForContent(long maxIdleTime) throws java.io.IOException
java.io.IOExceptionpublic int available()
throws java.io.IOException
java.io.IOExceptionCopyright © 2013 FuseSource, Corp.. All Rights Reserved.