Package io.netty.handler.codec.http2
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
public final class DefaultHttp2DataFrame extends AbstractHttp2StreamFrame implements Http2DataFrame
The defaultHttp2DataFrameimplementation.
-
-
Constructor Summary
Constructors Constructor Description DefaultHttp2DataFrame(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBufcontent()Payload of DATA frame.DefaultHttp2DataFramecopy()Creates a deep copy of thisByteBufHolder.DefaultHttp2DataFrameduplicate()Duplicates thisByteBufHolder.booleanequals(java.lang.Object o)Returnstrueifohas equalstreamto this object.inthashCode()intinitialFlowControlledBytes()Returns the number of bytes that are flow-controlled initially, so even if theHttp2DataFrame.content()is consumed this will not change.booleanisEndStream()Returnstrueif the END_STREAM flag is set.java.lang.Stringname()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.DefaultHttp2DataFramereplace(ByteBuf content)Returns a newByteBufHolderwhich contains the specifiedcontent.DefaultHttp2DataFrameretain()Increases the reference count by1.DefaultHttp2DataFrameretain(int increment)Increases the reference count by the specifiedincrement.DefaultHttp2DataFrameretainedDuplicate()Duplicates thisByteBufHolder.DefaultHttp2DataFramestream(Http2FrameStream stream)Set theHttp2FrameStreamobject for this frame.java.lang.StringtoString()DefaultHttp2DataFrametouch()Records the current access location of this object for debugging purposes.DefaultHttp2DataFrametouch(java.lang.Object hint)Records the current access location of this object with an additional arbitrary information for debugging purposes.-
Methods inherited from class io.netty.handler.codec.http2.AbstractHttp2StreamFrame
stream
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty.handler.codec.http2.Http2StreamFrame
stream
-
-
-
-
Constructor Detail
-
DefaultHttp2DataFrame
public DefaultHttp2DataFrame(ByteBuf content)
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
public DefaultHttp2DataFrame(ByteBuf content, boolean endStream)
Equivalent tonew DefaultHttp2DataFrame(content, endStream, 0).- Parameters:
content- non-nullpayloadendStream- whether this data should terminate the stream
-
DefaultHttp2DataFrame
public DefaultHttp2DataFrame(ByteBuf content, boolean endStream, int padding)
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 Detail
-
stream
public DefaultHttp2DataFrame stream(Http2FrameStream stream)
Description copied from interface:Http2StreamFrameSet theHttp2FrameStreamobject for this frame.- Specified by:
streamin interfaceHttp2StreamFrame- Overrides:
streamin classAbstractHttp2StreamFrame
-
name
public java.lang.String 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
public ByteBuf 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
public DefaultHttp2DataFrame copy()
Description copied from interface:ByteBufHolderCreates a deep copy of thisByteBufHolder.- Specified by:
copyin interfaceByteBufHolder- Specified by:
copyin interfaceHttp2DataFrame
-
duplicate
public DefaultHttp2DataFrame 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
public DefaultHttp2DataFrame 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:
ByteBuf.retainedDuplicate()
-
replace
public DefaultHttp2DataFrame replace(ByteBuf content)
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
public DefaultHttp2DataFrame retain()
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceByteBufHolder- Specified by:
retainin interfaceHttp2DataFrame- Specified by:
retainin interfaceReferenceCounted
-
retain
public DefaultHttp2DataFrame retain(int increment)
Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceByteBufHolder- Specified by:
retainin interfaceHttp2DataFrame- Specified by:
retainin interfaceReferenceCounted
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
touch
public DefaultHttp2DataFrame 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
public DefaultHttp2DataFrame touch(java.lang.Object hint)
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
public boolean equals(java.lang.Object o)
Description copied from class:AbstractHttp2StreamFrameReturnstrueifohas equalstreamto this object.- Overrides:
equalsin classAbstractHttp2StreamFrame
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractHttp2StreamFrame
-
-