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

public final Class DefaultHttp2DataFrame

extends AbstractHttp2StreamFrame
implements Http2DataFrame
Class Inheritance
All Implemented Interfaces
io.netty.handler.codec.http2.Http2DataFrame, io.netty.buffer.ByteBufHolder, io.netty.util.ReferenceCounted, io.netty.handler.codec.http2.Http2StreamFrame, io.netty.handler.codec.http2.Http2Frame
Annotations
@UnstableApi
Imports
io.netty.buffer.ByteBuf, .ByteBufUtil, .Unpooled, io.netty.util.internal.StringUtil, .UnstableApi

The default Http2DataFrame implementation.

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
DefaultHttp2DataFrame(ByteBuf
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(ByteBuf
non-null payload
content
,
boolean
whether this data should terminate the stream
endStream
)

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

public
DefaultHttp2DataFrame(ByteBuf
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.

Method Summary

Modifier and TypeMethod and Description
public ByteBuf
public DefaultHttp2DataFrame
copy()

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

Creates a deep copy of this ByteBufHolder.
public DefaultHttp2DataFrame
public boolean
equals(Object
the reference object with which to compare.
o
)

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

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

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

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

Implements io.netty.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
isEndStream()

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

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

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

Returns the name of the HTTP/2 frame e.g. DATA, GOAWAY, etc.
public int
public int
refCnt()

Implements io.netty.util.ReferenceCounted.refCnt.

Returns the reference count of this object.
public boolean
release()

Implements io.netty.util.ReferenceCounted.release.

Decreases the reference count by 1 and deallocates this object if the reference count reaches at 0.
public boolean
release(int decrement)

Implements io.netty.util.ReferenceCounted.release.

Decreases the reference count by the specified decrement and deallocates this object if the reference count reaches at 0.
public DefaultHttp2DataFrame
replace(ByteBuf content)

Implements io.netty.handler.codec.http2.Http2DataFrame.replace.

Returns a new ByteBufHolder which contains the specified content.
public DefaultHttp2DataFrame
retain()

Implements io.netty.handler.codec.http2.Http2DataFrame.retain.

Increases the reference count by 1.
public DefaultHttp2DataFrame
retain(int increment)

Implements io.netty.handler.codec.http2.Http2DataFrame.retain.

Increases the reference count by the specified increment.
public DefaultHttp2DataFrame
public DefaultHttp2DataFrame
public String
toString()

Overrides java.lang.Object.toString.

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

Implements io.netty.handler.codec.http2.Http2DataFrame.touch.

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

Implements io.netty.handler.codec.http2.Http2DataFrame.touch.

Records the current access location of this object with an additional arbitrary information for debugging purposes.
Inherited from io.netty.handler.codec.http2.AbstractHttp2StreamFrame:
stream

Field Detail

contentback to summary
private final ByteBuf 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(ByteBuf content)

Equivalent to new DefaultHttp2DataFrame(content, false).

Parameters
content:ByteBuf

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(ByteBuf content, boolean endStream)

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

Parameters
content:ByteBuf

non-null payload

endStream:boolean

whether this data should terminate the stream

DefaultHttp2DataFrameback to summary
public DefaultHttp2DataFrame(ByteBuf content, boolean endStream, int padding)

Construct a new data message.

Parameters
content:ByteBuf

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).

Method Detail

contentback to summary
public ByteBuf content()

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

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

Payload of DATA frame. Will not be null.

Annotations
@Override
copyback to summary
public DefaultHttp2DataFrame copy()

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

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

Creates a deep copy of this ByteBufHolder.

Annotations
@Override
duplicateback to summary
public DefaultHttp2DataFrame duplicate()

Implements io.netty.handler.codec.http2.Http2DataFrame.duplicate.

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

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

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

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

Doc from io.netty.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.netty.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.netty.handler.codec.http2.Http2DataFrame.initialFlowControlledBytes.

Doc from io.netty.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
isEndStreamback to summary
public boolean isEndStream()

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

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

Returns true if the END_STREAM flag is set.

Annotations
@Override
nameback to summary
public String name()

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

Doc from io.netty.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.netty.handler.codec.http2.Http2DataFrame.padding.

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

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

Annotations
@Override
refCntback to summary
public int refCnt()

Implements io.netty.util.ReferenceCounted.refCnt.

Doc from io.netty.util.ReferenceCounted.refCnt.

Returns the reference count of this object. If 0, it means this object has been deallocated.

Annotations
@Override
releaseback to summary
public boolean release()

Implements io.netty.util.ReferenceCounted.release.

Doc from io.netty.util.ReferenceCounted.release.

Decreases the reference count by 1 and deallocates this object if the reference count reaches at 0.

Returns:boolean

true if and only if the reference count became 0 and this object has been deallocated

Annotations
@Override
releaseback to summary
public boolean release(int decrement)

Implements io.netty.util.ReferenceCounted.release.

Doc from io.netty.util.ReferenceCounted.release.

Decreases the reference count by the specified decrement and deallocates this object if the reference count reaches at 0.

Returns:boolean

true if and only if the reference count became 0 and this object has been deallocated

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

Implements io.netty.handler.codec.http2.Http2DataFrame.replace.

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

Returns a new ByteBufHolder which contains the specified content.

Annotations
@Override
retainback to summary
public DefaultHttp2DataFrame retain()

Implements io.netty.handler.codec.http2.Http2DataFrame.retain.

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

Increases the reference count by 1.

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

Implements io.netty.handler.codec.http2.Http2DataFrame.retain.

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

Increases the reference count by the specified increment.

Annotations
@Override
retainedDuplicateback to summary
public DefaultHttp2DataFrame retainedDuplicate()

Implements io.netty.handler.codec.http2.Http2DataFrame.retainedDuplicate.

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

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

Annotations
@Override
streamback to summary
public DefaultHttp2DataFrame stream(Http2FrameStream stream)

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

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

Doc from io.netty.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()

Implements io.netty.handler.codec.http2.Http2DataFrame.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 DefaultHttp2DataFrame touch(Object hint)

Implements io.netty.handler.codec.http2.Http2DataFrame.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