Package io.netty5.handler.codec.http2
Class DefaultHttp2DataFrame
- java.lang.Object
-
- io.netty5.handler.codec.http2.AbstractHttp2StreamFrame
-
- io.netty5.handler.codec.http2.DefaultHttp2DataFrame
-
- All Implemented Interfaces:
Http2DataFrame,Http2Frame,Http2StreamFrame,io.netty5.util.Resource<Http2DataFrame>,AutoCloseable
@UnstableApi 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(io.netty5.util.Send<io.netty5.buffer.Buffer> content)Equivalent tonew DefaultHttp2DataFrame(content, false).DefaultHttp2DataFrame(io.netty5.util.Send<io.netty5.buffer.Buffer> content, boolean endStream)Equivalent tonew DefaultHttp2DataFrame(content, endStream, 0).DefaultHttp2DataFrame(io.netty5.util.Send<io.netty5.buffer.Buffer> content, boolean endStream, int padding)Construct a new data message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()io.netty5.buffer.Buffercontent()Payload of DATA frame.DefaultHttp2DataFramecopy()Produce a copy of this data frame, which contain a copy of the frame contents.booleanequals(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.booleanisAccessible()booleanisEndStream()Returnstrueif the END_STREAM flag is set.Stringname()Returns the name of the HTTP/2 frame e.g.intpadding()Frame padding to use.io.netty5.util.Send<Http2DataFrame>send()DefaultHttp2DataFramestream(Http2FrameStream stream)Set theHttp2FrameStreamobject for this frame.StringtoString()DefaultHttp2DataFrametouch(Object hint)-
Methods inherited from class io.netty5.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.netty5.handler.codec.http2.Http2StreamFrame
stream
-
-
-
-
Constructor Detail
-
DefaultHttp2DataFrame
public DefaultHttp2DataFrame(io.netty5.util.Send<io.netty5.buffer.Buffer> 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(io.netty5.util.Send<io.netty5.buffer.Buffer> content, boolean endStream)Equivalent tonew DefaultHttp2DataFrame(content, endStream, 0).- Parameters:
content- non-nullpayloadendStream- whether this data should terminate the stream
-
DefaultHttp2DataFrame
public DefaultHttp2DataFrame(io.netty5.util.Send<io.netty5.buffer.Buffer> 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 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 io.netty5.buffer.Buffer content()
Description copied from interface:Http2DataFramePayload of DATA frame. Will not benull.- 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:Http2DataFrameProduce a copy of this data frame, which contain a copy of the frame contents.- Specified by:
copyin interfaceHttp2DataFrame- Returns:
- A copy of this data frame.
-
send
public io.netty5.util.Send<Http2DataFrame> send()
- Specified by:
sendin interfaceio.netty5.util.Resource<Http2DataFrame>
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceio.netty5.util.Resource<Http2DataFrame>
-
isAccessible
public boolean isAccessible()
- Specified by:
isAccessiblein interfaceio.netty5.util.Resource<Http2DataFrame>
-
touch
public DefaultHttp2DataFrame touch(Object hint)
- Specified by:
touchin interfaceio.netty5.util.Resource<Http2DataFrame>
-
equals
public boolean equals(Object o)
Description copied from class:AbstractHttp2StreamFrameReturnstrueifohas equalstreamto this object.- Overrides:
equalsin classAbstractHttp2StreamFrame
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractHttp2StreamFrame
-
-