Top Description Fields Constructors Methods
io.netty.handler.codec.http

public Class DefaultLastHttpContent

extends DefaultHttpContent
implements LastHttpContent
Class Inheritance
All Implemented Interfaces
io.netty.handler.codec.http.LastHttpContent, io.netty.handler.codec.http.HttpContent, io.netty.buffer.ByteBufHolder, io.netty.util.ReferenceCounted, io.netty.handler.codec.http.HttpObject, io.netty.handler.codec.DecoderResultProvider
Imports
io.netty.buffer.ByteBuf, .Unpooled, io.netty.util.internal.StringUtil, java.util.Map.Entry

The default LastHttpContent implementation.

Field Summary

Modifier and TypeField and Description
private final HttpHeaders

Constructor Summary

AccessConstructor and Description
public
DefaultLastHttpContent()

Create a new empty, last HTTP content message.

public
DefaultLastHttpContent(ByteBuf content)

Create a new last HTTP content message with the given contents.

public
DefaultLastHttpContent(ByteBuf content, boolean validateHeaders)

Deprecated Prefer the DefaultLastHttpContent(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.
public
DefaultLastHttpContent(ByteBuf content, HttpHeadersFactory trailersFactory)

Create a new last HTTP content message with the given contents, and trailing headers from the given factory.

public
DefaultLastHttpContent(ByteBuf content, HttpHeaders trailingHeaders)

Create a new last HTTP content message with the given contents, and trailing headers.

Method Summary

Modifier and TypeMethod and Description
private void
public LastHttpContent
public LastHttpContent
public LastHttpContent
public LastHttpContent
public LastHttpContent
public LastHttpContent
public String
toString()

Overrides io.netty.handler.codec.http.DefaultHttpContent.toString.

Returns a string representation of the object.
public LastHttpContent
touch()

Overrides io.netty.handler.codec.http.DefaultHttpContent.touch.

Implements io.netty.handler.codec.http.LastHttpContent.touch, io.netty.handler.codec.http.HttpContent.touch.

Records the current access location of this object for debugging purposes.
public LastHttpContent
touch(Object hint)

Overrides io.netty.handler.codec.http.DefaultHttpContent.touch.

Implements io.netty.handler.codec.http.LastHttpContent.touch, io.netty.handler.codec.http.HttpContent.touch.

Records the current access location of this object with an additional arbitrary information for debugging purposes.
public HttpHeaders
Inherited from io.netty.handler.codec.http.DefaultHttpContent:
contentrefCntreleaserelease

Field Detail

trailingHeadersback to summary
private final HttpHeaders trailingHeaders

Constructor Detail

DefaultLastHttpContentback to summary
public DefaultLastHttpContent()

Create a new empty, last HTTP content message.

DefaultLastHttpContentback to summary
public DefaultLastHttpContent(ByteBuf content)

Create a new last HTTP content message with the given contents.

DefaultLastHttpContentback to summary
public DefaultLastHttpContent(ByteBuf content, boolean validateHeaders)

Deprecated

Prefer the DefaultLastHttpContent(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 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.

Annotations
@Deprecated
DefaultLastHttpContentback to summary
public DefaultLastHttpContent(ByteBuf content, HttpHeadersFactory trailersFactory)

Create a new last HTTP content message with the given contents, and trailing headers from the given factory.

DefaultLastHttpContentback to summary
public DefaultLastHttpContent(ByteBuf content, HttpHeaders trailingHeaders)

Create a new last HTTP content message with the given contents, and trailing headers.

Method Detail

appendHeadersback to summary
private void appendHeaders(StringBuilder buf)
copyback to summary
public LastHttpContent copy()

Overrides io.netty.handler.codec.http.DefaultHttpContent.copy.

Implements io.netty.handler.codec.http.LastHttpContent.copy, io.netty.handler.codec.http.HttpContent.copy.

Doc from io.netty.buffer.ByteBufHolder.copy.

Creates a deep copy of this ByteBufHolder.

Annotations
@Override
duplicateback to summary
public LastHttpContent duplicate()

Overrides io.netty.handler.codec.http.DefaultHttpContent.duplicate.

Implements io.netty.handler.codec.http.LastHttpContent.duplicate, io.netty.handler.codec.http.HttpContent.duplicate.

Doc from io.netty.buffer.ByteBufHolder.duplicate.

Duplicates this ByteBufHolder. Be aware that this will not automatically call retain().

Annotations
@Override
replaceback to summary
public LastHttpContent replace(ByteBuf content)

Overrides io.netty.handler.codec.http.DefaultHttpContent.replace.

Implements io.netty.handler.codec.http.LastHttpContent.replace, io.netty.handler.codec.http.HttpContent.replace.

Doc from io.netty.buffer.ByteBufHolder.replace.

Returns a new ByteBufHolder which contains the specified content.

Annotations
@Override
retainback to summary
public LastHttpContent retain(int increment)

Overrides io.netty.handler.codec.http.DefaultHttpContent.retain.

Implements io.netty.handler.codec.http.LastHttpContent.retain, io.netty.handler.codec.http.HttpContent.retain.

Doc from io.netty.util.ReferenceCounted.retain.

Increases the reference count by the specified increment.

Annotations
@Override
retainback to summary
public LastHttpContent retain()

Overrides io.netty.handler.codec.http.DefaultHttpContent.retain.

Implements io.netty.handler.codec.http.LastHttpContent.retain, io.netty.handler.codec.http.HttpContent.retain.

Doc from io.netty.util.ReferenceCounted.retain.

Increases the reference count by 1.

Annotations
@Override
retainedDuplicateback to summary
public LastHttpContent retainedDuplicate()

Overrides io.netty.handler.codec.http.DefaultHttpContent.retainedDuplicate.

Implements io.netty.handler.codec.http.LastHttpContent.retainedDuplicate, io.netty.handler.codec.http.HttpContent.retainedDuplicate.

Doc from io.netty.buffer.ByteBufHolder.retainedDuplicate.

Duplicates this ByteBufHolder. This method returns a retained duplicate unlike duplicate().

Annotations
@Override
toStringback to summary
public String toString()

Overrides io.netty.handler.codec.http.DefaultHttpContent.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
touchback to summary
public LastHttpContent touch()

Overrides io.netty.handler.codec.http.DefaultHttpContent.touch.

Implements io.netty.handler.codec.http.LastHttpContent.touch, io.netty.handler.codec.http.HttpContent.touch.

Doc from io.netty.util.ReferenceCounted.touch.

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 via ResourceLeakDetector. This method is a shortcut to touch(null).

Annotations
@Override
touchback to summary
public LastHttpContent touch(Object hint)

Overrides io.netty.handler.codec.http.DefaultHttpContent.touch.

Implements io.netty.handler.codec.http.LastHttpContent.touch, io.netty.handler.codec.http.HttpContent.touch.

Doc from io.netty.util.ReferenceCounted.touch.

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 via ResourceLeakDetector.

Annotations
@Override
trailingHeadersback to summary
public HttpHeaders trailingHeaders()

Implements io.netty.handler.codec.http.LastHttpContent.trailingHeaders.

Annotations
@Override