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

public final Class DefaultHttp2DataFrame

extends AbstractHttp2StreamFrame
implements Http2DataFrame
Class Inheritance
All Implemented Interfaces
io.netty5.handler.codec.http2.Http2DataFrame, io.netty5.util.Resource, java.lang.AutoCloseable, io.netty5.handler.codec.http2.Http2StreamFrame, io.netty5.handler.codec.http2.Http2Frame
Annotations
@UnstableApi
Imports
io.netty5.buffer.Buffer, .BufferClosedException, .DefaultBufferAllocators, io.netty5.util.Send, io.netty5.util.internal.StringUtil, .UnstableApi

The default Http2DataFrame implementation.

Field Summary

Modifier and TypeField and Description
private final Buffer
private final boolean
private final int
private final int

Constructor Summary

AccessConstructor and Description
public
DefaultHttp2DataFrame(Send<Buffer>
non-null payload
content
)

Equivalent to new DefaultHttp2DataFrame(content, false).

public
DefaultHttp2DataFrame(boolean
whether this data should terminate the stream
endStream
)

Equivalent to new DefaultHttp2DataFrame(Unpooled.EMPTY_BUFFER, endStream).

public
DefaultHttp2DataFrame(Send<Buffer>
non-null payload
content
,
boolean
whether this data should terminate the stream
endStream
)

Equivalent to new DefaultHttp2DataFrame(content, endStream, 0).

public
DefaultHttp2DataFrame(Send<Buffer>
non-null payload
content
,
boolean
whether this data should terminate the stream
endStream
,
int
additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).
padding
)

Construct a new data message.

private
DefaultHttp2DataFrame(Buffer content, boolean endStream, int padding)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements io.netty5.util.Resource.close.

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

Implements io.netty5.handler.codec.http2.Http2DataFrame.copy.

Produce a copy of this data frame, which contain a copy of the frame contents.
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides io.netty5.handler.codec.http2.AbstractHttp2StreamFrame.equals.

Returns true if o has equal stream to this object.
public int
hashCode()

Overrides io.netty5.handler.codec.http2.AbstractHttp2StreamFrame.hashCode.

Returns a hash code value for this object.
public int
initialFlowControlledBytes()

Implements io.netty5.handler.codec.http2.Http2DataFrame.initialFlowControlledBytes.

Returns the number of bytes that are flow-controlled initially, so even if the content() is consumed this will not change.
public boolean
isAccessible()

Implements io.netty5.util.Resource.isAccessible.

Check if this object is accessible.
public boolean
isEndStream()

Implements io.netty5.handler.codec.http2.Http2DataFrame.isEndStream.

Returns true if the END_STREAM flag is set.
public String
name()

Implements io.netty5.handler.codec.http2.Http2Frame.name.

Returns the name of the HTTP/2 frame e.g. DATA, GOAWAY, etc.
public int
public Send<Http2DataFrame>
send()

Implements io.netty5.util.Resource.send.

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

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public DefaultHttp2DataFrame
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.http2.AbstractHttp2StreamFrame:
stream

Field Detail

contentback to summary
private final Buffer content
endStreamback to summary
private final boolean endStream
initialFlowControlledBytesback to summary
private final int initialFlowControlledBytes
paddingback to summary
private final int padding

Constructor Detail

DefaultHttp2DataFrameback to summary
public DefaultHttp2DataFrame(Send<Buffer> content)

Equivalent to new DefaultHttp2DataFrame(content, false).

Parameters
content:Send<Buffer>

non-null payload

DefaultHttp2DataFrameback to summary
public DefaultHttp2DataFrame(boolean endStream)

Equivalent to new DefaultHttp2DataFrame(Unpooled.EMPTY_BUFFER, endStream).

Parameters
endStream:boolean

whether this data should terminate the stream

DefaultHttp2DataFrameback to summary
public DefaultHttp2DataFrame(Send<Buffer> content, boolean endStream)

Equivalent to new DefaultHttp2DataFrame(content, endStream, 0).

Parameters
content:Send<Buffer>

non-null payload

endStream:boolean

whether this data should terminate the stream

DefaultHttp2DataFrameback to summary
public DefaultHttp2DataFrame(Send<Buffer> content, boolean endStream, int padding)

Construct a new data message.

Parameters
content:Send<Buffer>

non-null payload

endStream:boolean

whether this data should terminate the stream

padding:int

additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).

DefaultHttp2DataFrameback to summary
private DefaultHttp2DataFrame(Buffer content, boolean endStream, int padding)

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
contentback to summary
public Buffer content()

Implements io.netty5.handler.codec.http2.Http2DataFrame.content.

Doc from io.netty5.handler.codec.http2.Http2DataFrame.content.

Payload of DATA frame. Will not be null.

Annotations
@Override
copyback to summary
public DefaultHttp2DataFrame copy()

Implements io.netty5.handler.codec.http2.Http2DataFrame.copy.

Doc from io.netty5.handler.codec.http2.Http2DataFrame.copy.

Produce a copy of this data frame, which contain a copy of the frame contents.

Returns:DefaultHttp2DataFrame

A copy of this data frame.

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Overrides io.netty5.handler.codec.http2.AbstractHttp2StreamFrame.equals.

Doc from io.netty5.handler.codec.http2.AbstractHttp2StreamFrame.equals.

Returns true if o has equal stream to this object.

Parameters
o:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides io.netty5.handler.codec.http2.AbstractHttp2StreamFrame.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
initialFlowControlledBytesback to summary
public int initialFlowControlledBytes()

Implements io.netty5.handler.codec.http2.Http2DataFrame.initialFlowControlledBytes.

Doc from io.netty5.handler.codec.http2.Http2DataFrame.initialFlowControlledBytes.

Returns the number of bytes that are flow-controlled initially, so even if the content() is consumed this will not change.

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
isEndStreamback to summary
public boolean isEndStream()

Implements io.netty5.handler.codec.http2.Http2DataFrame.isEndStream.

Doc from io.netty5.handler.codec.http2.Http2DataFrame.isEndStream.

Returns true if the END_STREAM flag is set.

Annotations
@Override
nameback to summary
public String name()

Implements io.netty5.handler.codec.http2.Http2Frame.name.

Doc from io.netty5.handler.codec.http2.Http2Frame.name.

Returns the name of the HTTP/2 frame e.g. DATA, GOAWAY, etc.

Annotations
@Override
paddingback to summary
public int padding()

Implements io.netty5.handler.codec.http2.Http2DataFrame.padding.

Doc from io.netty5.handler.codec.http2.Http2DataFrame.padding.

Frame padding to use. Will be non-negative and less than 256.

Annotations
@Override
sendback to summary
public Send<Http2DataFrame> 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
streamback to summary
public DefaultHttp2DataFrame stream(Http2FrameStream stream)

Overrides io.netty5.handler.codec.http2.AbstractHttp2StreamFrame.stream.

Implements io.netty5.handler.codec.http2.Http2StreamFrame.stream.

Doc from io.netty5.handler.codec.http2.Http2StreamFrame.stream.

Set the Http2FrameStream object for this frame.

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 DefaultHttp2DataFrame 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:DefaultHttp2DataFrame

This resource instance.

Annotations
@Override