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
public class DefaultLastHttpContent extends DefaultHttpContent implements LastHttpContent
The defaultLastHttpContentimplementation.
-
-
Field Summary
-
Fields inherited from interface io.netty.handler.codec.http.LastHttpContent
EMPTY_LAST_CONTENT
-
-
Constructor Summary
Constructors Constructor Description DefaultLastHttpContent()Create 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.Prefer theDefaultLastHttpContent(ByteBuf)constructor instead, to always have header validation enabled.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LastHttpContentcopy()Creates a deep copy of thisByteBufHolder.LastHttpContentduplicate()Duplicates thisByteBufHolder.LastHttpContentreplace(ByteBuf content)Returns a newByteBufHolderwhich contains the specifiedcontent.LastHttpContentretain()Increases the reference count by1.LastHttpContentretain(int increment)Increases the reference count by the specifiedincrement.LastHttpContentretainedDuplicate()Duplicates thisByteBufHolder.java.lang.StringtoString()LastHttpContenttouch()Records the current access location of this object for debugging purposes.LastHttpContenttouch(java.lang.Object hint)Records the current access location of this object with an additional arbitrary information for debugging purposes.HttpHeaderstrailingHeaders()-
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
-
-
-
-
Constructor Detail
-
DefaultLastHttpContent
public DefaultLastHttpContent()
Create a new empty, last HTTP content message.
-
DefaultLastHttpContent
public DefaultLastHttpContent(ByteBuf content)
Create a new last HTTP content message with the given contents.
-
DefaultLastHttpContent
@Deprecated public DefaultLastHttpContent(ByteBuf content, boolean validateHeaders)
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 & 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
public DefaultLastHttpContent(ByteBuf content, HttpHeadersFactory trailersFactory)
Create a new last HTTP content message with the given contents, and trailing headers from the given factory.
-
DefaultLastHttpContent
public DefaultLastHttpContent(ByteBuf content, HttpHeaders trailingHeaders)
Create a new last HTTP content message with the given contents, and trailing headers.
-
-
Method Detail
-
copy
public LastHttpContent 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
public LastHttpContent 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
public LastHttpContent 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:
ByteBuf.retainedDuplicate()
-
replace
public LastHttpContent replace(ByteBuf content)
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
public LastHttpContent retain(int increment)
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
public LastHttpContent 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
public LastHttpContent 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
public LastHttpContent touch(java.lang.Object hint)
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
public HttpHeaders trailingHeaders()
- Specified by:
trailingHeadersin interfaceLastHttpContent
-
toString
public java.lang.String toString()
- Overrides:
toStringin classDefaultHttpContent
-
-