Package io.netty.handler.codec.http
Class DefaultLastHttpContent
java.lang.Object
io.netty.handler.codec.http.DefaultHttpObject
io.netty.handler.codec.http.DefaultHttpContent
io.netty.handler.codec.http.DefaultLastHttpContent
- All Implemented Interfaces:
ByteBufHolder
,DecoderResultProvider
,HttpContent
,HttpObject
,LastHttpContent
,ReferenceCounted
The default
LastHttpContent
implementation.-
Field Summary
FieldsFields inherited from interface io.netty.handler.codec.http.LastHttpContent
EMPTY_LAST_CONTENT
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new empty, last HTTP content message.DefaultLastHttpContent
(ByteBuf content) Create a new last HTTP content message with the given contents.DefaultLastHttpContent
(ByteBuf content, boolean validateHeaders) Deprecated.DefaultLastHttpContent
(ByteBuf content, HttpHeaders trailingHeaders) Create a new last HTTP content message with the given contents, and trailing headers.DefaultLastHttpContent
(ByteBuf content, HttpHeadersFactory trailersFactory) Create a new last HTTP content message with the given contents, and trailing headers from the given factory. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
copy()
Creates a deep copy of thisByteBufHolder
.Duplicates thisByteBufHolder
.Returns a newByteBufHolder
which contains the specifiedcontent
.retain()
Increases the reference count by1
.retain
(int increment) Increases the reference count by the specifiedincrement
.Duplicates thisByteBufHolder
.toString()
touch()
Records the current access location of this object for debugging purposes.Records the current access location of this object with an additional arbitrary information for debugging purposes.Methods inherited from class io.netty.handler.codec.http.DefaultHttpContent
content, refCnt, release, release
Methods inherited from class io.netty.handler.codec.http.DefaultHttpObject
decoderResult, equals, getDecoderResult, hashCode, setDecoderResult
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.netty.buffer.ByteBufHolder
content
Methods inherited from interface io.netty.handler.codec.DecoderResultProvider
decoderResult, setDecoderResult
Methods inherited from interface io.netty.handler.codec.http.HttpObject
getDecoderResult
Methods inherited from interface io.netty.util.ReferenceCounted
refCnt, release, release
-
Field Details
-
trailingHeaders
-
-
Constructor Details
-
DefaultLastHttpContent
public DefaultLastHttpContent()Create a new empty, last HTTP content message. -
DefaultLastHttpContent
Create a new last HTTP content message with the given contents. -
DefaultLastHttpContent
Deprecated.Prefer theDefaultLastHttpContent(ByteBuf)
constructor instead, to always have header validation enabled.Create a new last HTTP content message with the given contents, and optional trailing header validation.Warning! Setting
validateHeaders
tofalse
will mean that Netty won't validate invalid input: '&' protect against user-supplied header values that are malicious. This can leave your server implementation vulnerable to CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response Splitting') . When disabling this validation, it is the responsibility of the caller to ensure that the values supplied do not contain a non-url-escaped carriage return (CR) and/or line feed (LF) characters. -
DefaultLastHttpContent
Create a new last HTTP content message with the given contents, and trailing headers from the given factory. -
DefaultLastHttpContent
Create a new last HTTP content message with the given contents, and trailing headers.
-
-
Method Details
-
copy
Description copied from interface:ByteBufHolder
Creates a deep copy of thisByteBufHolder
.- Specified by:
copy
in interfaceByteBufHolder
- Specified by:
copy
in interfaceHttpContent
- Specified by:
copy
in interfaceLastHttpContent
- Overrides:
copy
in classDefaultHttpContent
-
duplicate
Description copied from interface:ByteBufHolder
Duplicates thisByteBufHolder
. Be aware that this will not automatically callByteBufHolder.retain()
.- Specified by:
duplicate
in interfaceByteBufHolder
- Specified by:
duplicate
in interfaceHttpContent
- Specified by:
duplicate
in interfaceLastHttpContent
- Overrides:
duplicate
in classDefaultHttpContent
-
retainedDuplicate
Description copied from interface:ByteBufHolder
Duplicates thisByteBufHolder
. This method returns a retained duplicate unlikeByteBufHolder.duplicate()
.- Specified by:
retainedDuplicate
in interfaceByteBufHolder
- Specified by:
retainedDuplicate
in interfaceHttpContent
- Specified by:
retainedDuplicate
in interfaceLastHttpContent
- Overrides:
retainedDuplicate
in classDefaultHttpContent
- See Also:
-
replace
Description copied from interface:ByteBufHolder
Returns a newByteBufHolder
which contains the specifiedcontent
.- Specified by:
replace
in interfaceByteBufHolder
- Specified by:
replace
in interfaceHttpContent
- Specified by:
replace
in interfaceLastHttpContent
- Overrides:
replace
in classDefaultHttpContent
-
retain
Description copied from interface:ReferenceCounted
Increases the reference count by the specifiedincrement
.- Specified by:
retain
in interfaceByteBufHolder
- Specified by:
retain
in interfaceHttpContent
- Specified by:
retain
in interfaceLastHttpContent
- Specified by:
retain
in interfaceReferenceCounted
- Overrides:
retain
in classDefaultHttpContent
-
retain
Description copied from interface:ReferenceCounted
Increases the reference count by1
.- Specified by:
retain
in interfaceByteBufHolder
- Specified by:
retain
in interfaceHttpContent
- Specified by:
retain
in interfaceLastHttpContent
- Specified by:
retain
in interfaceReferenceCounted
- Overrides:
retain
in classDefaultHttpContent
-
touch
Description copied from interface:ReferenceCounted
Records the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector
. This method is a shortcut totouch(null)
.- Specified by:
touch
in interfaceByteBufHolder
- Specified by:
touch
in interfaceHttpContent
- Specified by:
touch
in interfaceLastHttpContent
- Specified by:
touch
in interfaceReferenceCounted
- Overrides:
touch
in classDefaultHttpContent
-
touch
Description copied from interface:ReferenceCounted
Records the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector
.- Specified by:
touch
in interfaceByteBufHolder
- Specified by:
touch
in interfaceHttpContent
- Specified by:
touch
in interfaceLastHttpContent
- Specified by:
touch
in interfaceReferenceCounted
- Overrides:
touch
in classDefaultHttpContent
-
trailingHeaders
- Specified by:
trailingHeaders
in interfaceLastHttpContent
-
toString
- Overrides:
toString
in classDefaultHttpContent
-
appendHeaders
-
DefaultLastHttpContent(ByteBuf)
constructor instead, to always have header validation enabled.