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
Fields inherited from interface 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 TypeMethodDescriptioncopy()Creates a deep copy of thisByteBufHolder.Duplicates thisByteBufHolder.Returns a newByteBufHolderwhich 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 DefaultHttpContent
content, refCnt, release, releaseMethods inherited from class DefaultHttpObject
decoderResult, equals, getDecoderResult, hashCode, setDecoderResultMethods inherited from interface ByteBufHolder
contentMethods inherited from interface DecoderResultProvider
decoderResult, setDecoderResultMethods inherited from interface HttpObject
getDecoderResultMethods inherited from interface ReferenceCounted
refCnt, release, release
-
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
validateHeaderstofalsewill 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:ByteBufHolderCreates a deep copy of thisByteBufHolder.- Specified by:
copyin interfaceByteBufHolder- Specified by:
copyin interfaceHttpContent- Specified by:
copyin interfaceLastHttpContent- Overrides:
copyin classDefaultHttpContent
-
duplicate
Description copied from interface:ByteBufHolderDuplicates thisByteBufHolder. Be aware that this will not automatically callByteBufHolder.retain().- Specified by:
duplicatein interfaceByteBufHolder- Specified by:
duplicatein interfaceHttpContent- Specified by:
duplicatein interfaceLastHttpContent- Overrides:
duplicatein classDefaultHttpContent
-
retainedDuplicate
Description copied from interface:ByteBufHolderDuplicates thisByteBufHolder. This method returns a retained duplicate unlikeByteBufHolder.duplicate().- Specified by:
retainedDuplicatein interfaceByteBufHolder- Specified by:
retainedDuplicatein interfaceHttpContent- Specified by:
retainedDuplicatein interfaceLastHttpContent- Overrides:
retainedDuplicatein classDefaultHttpContent- See Also:
-
replace
Description copied from interface:ByteBufHolderReturns a newByteBufHolderwhich contains the specifiedcontent.- Specified by:
replacein interfaceByteBufHolder- Specified by:
replacein interfaceHttpContent- Specified by:
replacein interfaceLastHttpContent- Overrides:
replacein classDefaultHttpContent
-
retain
Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceByteBufHolder- Specified by:
retainin interfaceHttpContent- Specified by:
retainin interfaceLastHttpContent- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classDefaultHttpContent
-
retain
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceByteBufHolder- Specified by:
retainin interfaceHttpContent- Specified by:
retainin interfaceLastHttpContent- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classDefaultHttpContent
-
touch
Description copied from interface:ReferenceCountedRecords 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:
touchin interfaceByteBufHolder- Specified by:
touchin interfaceHttpContent- Specified by:
touchin interfaceLastHttpContent- Specified by:
touchin interfaceReferenceCounted- Overrides:
touchin classDefaultHttpContent
-
touch
Description copied from interface:ReferenceCountedRecords 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:
touchin interfaceByteBufHolder- Specified by:
touchin interfaceHttpContent- Specified by:
touchin interfaceLastHttpContent- Specified by:
touchin interfaceReferenceCounted- Overrides:
touchin classDefaultHttpContent
-
trailingHeaders
- Specified by:
trailingHeadersin interfaceLastHttpContent
-
toString
- Overrides:
toStringin classDefaultHttpContent
-
DefaultLastHttpContent(ByteBuf)constructor instead, to always have header validation enabled.