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

public Class DefaultHttpContent

extends DefaultHttpObject
implements HttpContent<DefaultHttpContent>
Class Inheritance
All Implemented Interfaces
io.netty5.handler.codec.http.HttpContent, io.netty5.util.Resource, java.lang.AutoCloseable, io.netty5.handler.codec.http.HttpObject, io.netty5.handler.codec.DecoderResultProvider
Imports
io.netty5.buffer.Buffer, io.netty5.util.Send, io.netty5.util.internal.StringUtil

The default HttpContent implementation.

Field Summary

Modifier and TypeField and Description
private final Buffer

Constructor Summary

AccessConstructor and Description
public
DefaultHttpContent(Buffer payload)

Creates a new instance with the specified chunk content.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements io.netty5.util.Resource.close.

Close the resource, making it inaccessible.
public DefaultHttpContent
copy()

Implements io.netty5.handler.codec.http.HttpContent.copy.

Create a copy of this HTTP content instance, and return it.
public boolean
isAccessible()

Implements io.netty5.util.Resource.isAccessible.

Check if this object is accessible.
public Buffer
payload()

Implements io.netty5.handler.codec.http.HttpContent.payload.

Returns the Buffer representing the payload of the HTTP message.
public Send<DefaultHttpContent>
send()

Implements io.netty5.util.Resource.send.

Send this object instance to another Thread, transferring the ownership to the recipient.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public DefaultHttpContent
touch(Object
An optional hint about this access and its context. May be null.
hint
)

Overrides default io.netty5.util.Resource.touch.

Record the current access location for debugging purposes.
Inherited from io.netty5.handler.codec.http.DefaultHttpObject:
decoderResultequalshashCodesetDecoderResult

Field Detail

payloadback to summary
private final Buffer payload

Constructor Detail

DefaultHttpContentback to summary
public DefaultHttpContent(Buffer payload)

Creates a new instance with the specified chunk content.

Method Detail

closeback to summary
public void close()

Implements io.netty5.util.Resource.close.

Doc from io.netty5.util.Resource.close.

Close the resource, making it inaccessible.

Note, this method is not thread-safe unless otherwise specified.

Annotations
@Override
copyback to summary
public DefaultHttpContent copy()

Implements io.netty5.handler.codec.http.HttpContent.copy.

Doc from io.netty5.handler.codec.http.HttpContent.copy.

Create a copy of this HTTP content instance, and return it.

Returns:DefaultHttpContent

A copy of this HTTP content object.

Annotations
@Override
isAccessibleback to summary
public boolean isAccessible()

Implements io.netty5.util.Resource.isAccessible.

Doc from io.netty5.util.Resource.isAccessible.

Check if this object is accessible.

Returns:boolean

true if this object is still valid and can be accessed, otherwise false if, for instance, this object has been dropped/deallocated, or been sent elsewhere.

Annotations
@Override
payloadback to summary
public Buffer payload()

Implements io.netty5.handler.codec.http.HttpContent.payload.

Doc from io.netty5.handler.codec.http.HttpContent.payload.

Returns the Buffer representing the payload of the HTTP message.

Returns:Buffer

The Buffer representing the payload of the HTTP message.

Annotations
@Override
sendback to summary
public Send<DefaultHttpContent> send()

Implements io.netty5.util.Resource.send.

Doc from io.netty5.util.Resource.send.

Send this object instance to another Thread, transferring the ownership to the recipient.

The object must be in a state where it can be sent, which includes at least being accessible.

When sent, this instance will immediately become inaccessible, as if by closing it. All attempts at accessing an object that has been sent, even if that object has not yet been received, should cause an exception to be thrown.

Calling close() on an object that has been sent will have no effect, so this method is safe to call within a try-with-resources statement.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.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 DefaultHttpContent touch(Object hint)

Overrides default io.netty5.util.Resource.touch.

Doc from io.netty5.util.Resource.touch.

Record the current access location for debugging purposes. This information may be included if the resource throws a life-cycle related exception, or if it leaks. If this resource has already been closed, then this method has no effect.

Parameters
hint:Object

An optional hint about this access and its context. May be null.

Returns:DefaultHttpContent

This resource instance.

Annotations
@Override