Class DefaultHttp2DataFrame
java.lang.Object
io.netty.handler.codec.http2.AbstractHttp2StreamFrame
io.netty.handler.codec.http2.DefaultHttp2DataFrame
- All Implemented Interfaces:
ByteBufHolder, Http2DataFrame, Http2Frame, Http2StreamFrame, ReferenceCounted
The default
Http2DataFrame implementation.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultHttp2DataFrame(boolean endStream) Equivalent tonew DefaultHttp2DataFrame(Unpooled.EMPTY_BUFFER, endStream).DefaultHttp2DataFrame(ByteBuf content) Equivalent tonew DefaultHttp2DataFrame(content, false).DefaultHttp2DataFrame(ByteBuf content, boolean endStream) Equivalent tonew DefaultHttp2DataFrame(content, endStream, 0).DefaultHttp2DataFrame(ByteBuf content, boolean endStream, int padding) Construct a new data message. -
Method Summary
Modifier and TypeMethodDescriptioncontent()Payload of DATA frame.copy()Creates a deep copy of thisByteBufHolder.Duplicates thisByteBufHolder.booleanReturnstrueifohas equalstreamto this object.inthashCode()intReturns the number of bytes that are flow-controlled initially, so even if theHttp2DataFrame.content()is consumed this will not change.booleanReturnstrueif the END_STREAM flag is set.name()Returns the name of the HTTP/2 frame e.g.intpadding()Frame padding to use.intrefCnt()Returns the reference count of this object.booleanrelease()Decreases the reference count by1and deallocates this object if the reference count reaches at0.booleanrelease(int decrement) Decreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.Returns a newByteBufHolderwhich contains the specifiedcontent.retain()Increases the reference count by1.retain(int increment) Increases the reference count by the specifiedincrement.Duplicates thisByteBufHolder.stream(Http2FrameStream stream) Set theHttp2FrameStreamobject for this frame.toString()touch()Records the current access location of this object for debugging purposes.Records the current access location of this object with an additional arbitrary information for debugging purposes.Methods inherited from class AbstractHttp2StreamFrame
streamMethods inherited from interface Http2StreamFrame
stream
-
Constructor Details
-
DefaultHttp2DataFrame
Equivalent tonew DefaultHttp2DataFrame(content, false).- Parameters:
content- non-nullpayload
-
DefaultHttp2DataFrame
public DefaultHttp2DataFrame(boolean endStream) Equivalent tonew DefaultHttp2DataFrame(Unpooled.EMPTY_BUFFER, endStream).- Parameters:
endStream- whether this data should terminate the stream
-
DefaultHttp2DataFrame
Equivalent tonew DefaultHttp2DataFrame(content, endStream, 0).- Parameters:
content- non-nullpayloadendStream- whether this data should terminate the stream
-
DefaultHttp2DataFrame
Construct a new data message.- Parameters:
content- non-nullpayloadendStream- whether this data should terminate the streampadding- additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).
-
-
Method Details
-
stream
Description copied from interface:Http2StreamFrameSet theHttp2FrameStreamobject for this frame.- Specified by:
streamin interfaceHttp2StreamFrame- Overrides:
streamin classAbstractHttp2StreamFrame
-
name
Description copied from interface:Http2FrameReturns the name of the HTTP/2 frame e.g. DATA, GOAWAY, etc.- Specified by:
namein interfaceHttp2Frame
-
isEndStream
public boolean isEndStream()Description copied from interface:Http2DataFrameReturnstrueif the END_STREAM flag is set.- Specified by:
isEndStreamin interfaceHttp2DataFrame
-
padding
public int padding()Description copied from interface:Http2DataFrameFrame padding to use. Will be non-negative and less than 256.- Specified by:
paddingin interfaceHttp2DataFrame
-
content
Description copied from interface:Http2DataFramePayload of DATA frame. Will not benull.- Specified by:
contentin interfaceByteBufHolder- Specified by:
contentin interfaceHttp2DataFrame
-
initialFlowControlledBytes
public int initialFlowControlledBytes()Description copied from interface:Http2DataFrameReturns the number of bytes that are flow-controlled initially, so even if theHttp2DataFrame.content()is consumed this will not change.- Specified by:
initialFlowControlledBytesin interfaceHttp2DataFrame
-
copy
Description copied from interface:ByteBufHolderCreates a deep copy of thisByteBufHolder.- Specified by:
copyin interfaceByteBufHolder- Specified by:
copyin interfaceHttp2DataFrame
-
duplicate
Description copied from interface:ByteBufHolderDuplicates thisByteBufHolder. Be aware that this will not automatically callByteBufHolder.retain().- Specified by:
duplicatein interfaceByteBufHolder- Specified by:
duplicatein interfaceHttp2DataFrame
-
retainedDuplicate
Description copied from interface:ByteBufHolderDuplicates thisByteBufHolder. This method returns a retained duplicate unlikeByteBufHolder.duplicate().- Specified by:
retainedDuplicatein interfaceByteBufHolder- Specified by:
retainedDuplicatein interfaceHttp2DataFrame- See Also:
-
replace
Description copied from interface:ByteBufHolderReturns a newByteBufHolderwhich contains the specifiedcontent.- Specified by:
replacein interfaceByteBufHolder- Specified by:
replacein interfaceHttp2DataFrame
-
refCnt
public int refCnt()Description copied from interface:ReferenceCountedReturns the reference count of this object. If0, it means this object has been deallocated.- Specified by:
refCntin interfaceReferenceCounted
-
release
public boolean release()Description copied from interface:ReferenceCountedDecreases the reference count by1and deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceReferenceCounted- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
release
public boolean release(int decrement) Description copied from interface:ReferenceCountedDecreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceReferenceCounted- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
retain
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceByteBufHolder- Specified by:
retainin interfaceHttp2DataFrame- Specified by:
retainin interfaceReferenceCounted
-
retain
Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceByteBufHolder- Specified by:
retainin interfaceHttp2DataFrame- Specified by:
retainin interfaceReferenceCounted
-
toString
-
touch
Description copied from interface:ReferenceCountedRecords 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 viaResourceLeakDetector. This method is a shortcut totouch(null).- Specified by:
touchin interfaceByteBufHolder- Specified by:
touchin interfaceHttp2DataFrame- Specified by:
touchin interfaceReferenceCounted
-
touch
Description copied from interface:ReferenceCountedRecords 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 viaResourceLeakDetector.- Specified by:
touchin interfaceByteBufHolder- Specified by:
touchin interfaceHttp2DataFrame- Specified by:
touchin interfaceReferenceCounted
-
equals
Description copied from class:AbstractHttp2StreamFrameReturnstrueifohas equalstreamto this object.- Overrides:
equalsin classAbstractHttp2StreamFrame
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractHttp2StreamFrame
-