public class DefaultLastHttpContent extends DefaultHttpContent implements LastHttpContent
LastHttpContent
implementation.EMPTY_LAST_CONTENT
Constructor and 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 the
DefaultLastHttpContent(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.
|
Modifier and Type | Method and Description |
---|---|
LastHttpContent |
copy()
Creates a deep copy of this
ByteBufHolder . |
LastHttpContent |
duplicate()
Duplicates this
ByteBufHolder . |
LastHttpContent |
replace(ByteBuf content)
Returns a new
ByteBufHolder which contains the specified content . |
LastHttpContent |
retain()
Increases the reference count by
1 . |
LastHttpContent |
retain(int increment)
Increases the reference count by the specified
increment . |
LastHttpContent |
retainedDuplicate()
Duplicates this
ByteBufHolder . |
String |
toString() |
LastHttpContent |
touch()
Records the current access location of this object for debugging purposes.
|
LastHttpContent |
touch(Object hint)
Records the current access location of this object with an additional arbitrary information for debugging
purposes.
|
HttpHeaders |
trailingHeaders() |
content, refCnt, release, release
decoderResult, equals, getDecoderResult, hashCode, setDecoderResult
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getDecoderResult
decoderResult, setDecoderResult
content
refCnt, release, release
public DefaultLastHttpContent()
public DefaultLastHttpContent(ByteBuf content)
@Deprecated public DefaultLastHttpContent(ByteBuf content, boolean validateHeaders)
DefaultLastHttpContent(ByteBuf)
constructor instead, to always have header
validation enabled.
Warning! Setting validateHeaders
to false
will 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.
public DefaultLastHttpContent(ByteBuf content, HttpHeadersFactory trailersFactory)
public DefaultLastHttpContent(ByteBuf content, HttpHeaders trailingHeaders)
public LastHttpContent copy()
ByteBufHolder
ByteBufHolder
.copy
in interface ByteBufHolder
copy
in interface HttpContent
copy
in interface LastHttpContent
copy
in class DefaultHttpContent
public LastHttpContent duplicate()
ByteBufHolder
ByteBufHolder
. Be aware that this will not automatically call ByteBufHolder.retain()
.duplicate
in interface ByteBufHolder
duplicate
in interface HttpContent
duplicate
in interface LastHttpContent
duplicate
in class DefaultHttpContent
public LastHttpContent retainedDuplicate()
ByteBufHolder
ByteBufHolder
. This method returns a retained duplicate unlike ByteBufHolder.duplicate()
.retainedDuplicate
in interface ByteBufHolder
retainedDuplicate
in interface HttpContent
retainedDuplicate
in interface LastHttpContent
retainedDuplicate
in class DefaultHttpContent
ByteBuf.retainedDuplicate()
public LastHttpContent replace(ByteBuf content)
ByteBufHolder
ByteBufHolder
which contains the specified content
.replace
in interface ByteBufHolder
replace
in interface HttpContent
replace
in interface LastHttpContent
replace
in class DefaultHttpContent
public LastHttpContent retain(int increment)
ReferenceCounted
increment
.retain
in interface ByteBufHolder
retain
in interface HttpContent
retain
in interface LastHttpContent
retain
in interface ReferenceCounted
retain
in class DefaultHttpContent
public LastHttpContent retain()
ReferenceCounted
1
.retain
in interface ByteBufHolder
retain
in interface HttpContent
retain
in interface LastHttpContent
retain
in interface ReferenceCounted
retain
in class DefaultHttpContent
public LastHttpContent touch()
ReferenceCounted
ResourceLeakDetector
. This method is a shortcut to touch(null)
.touch
in interface ByteBufHolder
touch
in interface HttpContent
touch
in interface LastHttpContent
touch
in interface ReferenceCounted
touch
in class DefaultHttpContent
public LastHttpContent touch(Object hint)
ReferenceCounted
ResourceLeakDetector
.touch
in interface ByteBufHolder
touch
in interface HttpContent
touch
in interface LastHttpContent
touch
in interface ReferenceCounted
touch
in class DefaultHttpContent
public HttpHeaders trailingHeaders()
trailingHeaders
in interface LastHttpContent
public String toString()
toString
in class DefaultHttpContent
Copyright © 2008–2024 The Netty Project. All rights reserved.