java.lang.Object
robaho.net.httpserver.http2.frame.BaseFrame
robaho.net.httpserver.http2.frame.HeadersFrame
[rfc7540 Section 6.2] The HEADERS frame (type=0x1) is used to open a stream
(Section 5.1), and additionally carries a header block fragment. HEADERS
frames can be sent on a stream in the "idle", "reserved (local)", "open", or
"half-closed (remote)" state.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]encode()longA 31-bit stream identifier for the stream that this stream depends on (see Section 5.3).byte[]A header block fragment (Section 4.3).booleanA single-bit flag indicating that the stream dependency is exclusive (see Section 5.3).byte[]Padding octets.intAn 8-bit field containing the length of the frame padding in units of octets.intAn unsigned 8-bit integer representing a priority weight for the stream (see Section 5.3).static HeadersFrameparse(byte[] frameBody, FrameHeader header) voidsetDependentStream(long streamIdentifier) voidsetHeaderBlock(byte[] headerBlock) voidsetIsExclusive(boolean isExclusive) voidsetPadding(byte[] padding) voidsetPadLength(int padLength) voidsetWeight(int weight) voidwriteTo(OutputStream os)
-
Constructor Details
-
HeadersFrame
public HeadersFrame() -
HeadersFrame
-
-
Method Details
-
getPadLength
public int getPadLength()An 8-bit field containing the length of the frame padding in units of octets. This field is only present if the PADDED flag is set. -
setPadLength
public void setPadLength(int padLength) -
getIsExclusive
public boolean getIsExclusive()A single-bit flag indicating that the stream dependency is exclusive (see Section 5.3). This field is only present if the PRIORITY flag is set. -
setIsExclusive
public void setIsExclusive(boolean isExclusive) -
getDependentStream
public long getDependentStream()A 31-bit stream identifier for the stream that this stream depends on (see Section 5.3). This field is only present if the PRIORITY flag is set. -
setDependentStream
public void setDependentStream(long streamIdentifier) -
getWeight
public int getWeight()An unsigned 8-bit integer representing a priority weight for the stream (see Section 5.3). Add one to the value to obtain a weight between 1 and 256. This field is only present if the PRIORITY flag is set. -
setWeight
public void setWeight(int weight) -
getHeaderBlock
public byte[] getHeaderBlock()A header block fragment (Section 4.3). -
setHeaderBlock
public void setHeaderBlock(byte[] headerBlock) -
getPadding
public byte[] getPadding()Padding octets. -
setPadding
public void setPadding(byte[] padding) -
parse
public static HeadersFrame parse(byte[] frameBody, FrameHeader header) throws HTTP2Exception, Exception - Parameters:
frameBody- payload of the HeadersFrame after consuming the FrameHeaderheader- FrameHeader- Returns:
- HeadersFrame object
- Throws:
HTTP2ExceptionException
-
writeTo
- Specified by:
writeToin classBaseFrame- Throws:
IOException
-
encode
public byte[] encode()
-