public class DefaultHttpMessage extends java.lang.Object implements HttpMessage
HttpMessage
implementation.限定符 | 构造器和说明 |
---|---|
protected |
DefaultHttpMessage(HttpVersion version)
Creates a new instance.
|
限定符和类型 | 方法和说明 |
---|---|
ChannelBuffer |
getContent()
Returns the content of this message.
|
HttpVersion |
getProtocolVersion()
Returns the protocol version of this message.
|
HttpHeaders |
headers()
Returns the headers of this message.
|
boolean |
isChunked()
Returns
true if and only if this message does not have any
content but the HttpChunk s, which is generated by
HttpMessageDecoder consecutively, contain the actual content. |
void |
setChunked(boolean chunked)
Sets if this message does not have any content but the
HttpChunk s, which is generated by HttpMessageDecoder
consecutively, contain the actual content. |
void |
setContent(ChannelBuffer content)
Sets the content of this message.
|
void |
setProtocolVersion(HttpVersion version)
Sets the protocol version of this message.
|
java.lang.String |
toString() |
protected DefaultHttpMessage(HttpVersion version)
public HttpHeaders headers()
HttpMessage
headers
在接口中 HttpMessage
public boolean isChunked()
HttpMessage
true
if and only if this message does not have any
content but the HttpChunk
s, which is generated by
HttpMessageDecoder
consecutively, contain the actual content.
Please note that this method will keep returning true
if the
"Transfer-Encoding"
of this message is "chunked"
, even if
you attempt to override this property by calling HttpMessage.setChunked(boolean)
with false
.
isChunked
在接口中 HttpMessage
public void setChunked(boolean chunked)
HttpMessage
HttpChunk
s, which is generated by HttpMessageDecoder
consecutively, contain the actual content.
If this method is called with true
, the content of this message
becomes ChannelBuffers.EMPTY_BUFFER
.
Even if this method is called with false
, HttpMessage.isChunked()
will keep returning true
if the "Transfer-Encoding"
of
this message is "chunked"
.
setChunked
在接口中 HttpMessage
public void setContent(ChannelBuffer content)
HttpMessage
null
is specified,
the content of this message will be set to ChannelBuffers.EMPTY_BUFFER
.setContent
在接口中 HttpMessage
public HttpVersion getProtocolVersion()
HttpMessage
getProtocolVersion
在接口中 HttpMessage
public void setProtocolVersion(HttpVersion version)
HttpMessage
setProtocolVersion
在接口中 HttpMessage
public ChannelBuffer getContent()
HttpMessage
HttpMessage.isChunked()
returns true
, an
ChannelBuffers.EMPTY_BUFFER
is returned.getContent
在接口中 HttpMessage
public java.lang.String toString()
toString
在类中 java.lang.Object