Package org.microproxy.frames
Record Class Http2Frame.Data
java.lang.Object
java.lang.Record
org.microproxy.frames.Http2Frame.Data
- Record Components:
streamId- the streamdata- the content, not copiedendStream- whether the frame ends the stream
- All Implemented Interfaces:
Http2Frame,HttpFrame
- Enclosing interface:
Http2Frame
public static record Http2Frame.Data(int streamId, byte[] data, boolean endStream)
extends Record
implements Http2Frame
DATA (section 6.1). Interceptors see DATA frames of at most 16 KiB; padding is not shown (it
is counted for flow control, and the proxy never sends any).
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.microproxy.frames.Http2Frame
Http2Frame.Data, Http2Frame.GoAway, Http2Frame.Headers, Http2Frame.Ping, Http2Frame.Priority, Http2Frame.PushPromise, Http2Frame.RstStream, Http2Frame.Settings, Http2Frame.Unknown, Http2Frame.WindowUpdate -
Field Summary
Fields inherited from interface org.microproxy.frames.Http2Frame
ERROR_NAMES, SETTING_NAMES, SETTINGS_ENABLE_CONNECT_PROTOCOL, SETTINGS_ENABLE_PUSH, SETTINGS_HEADER_TABLE_SIZE, SETTINGS_INITIAL_WINDOW_SIZE, SETTINGS_MAX_CONCURRENT_STREAMS, SETTINGS_MAX_FRAME_SIZE, SETTINGS_MAX_HEADER_LIST_SIZE, TYPE_CONTINUATION, TYPE_DATA, TYPE_GOAWAY, TYPE_HEADERS, TYPE_PING, TYPE_PRIORITY, TYPE_PUSH_PROMISE, TYPE_RST_STREAM, TYPE_SETTINGS, TYPE_WINDOW_UPDATE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]data()Returns the value of thedatarecord component.booleanReturns the value of theendStreamrecord component.booleanCompares the content, not the array's identity.inthashCode()Returns a hash code value for this object.intstreamId()Returns the value of thestreamIdrecord component.text()The content as UTF-8 text (malformed sequences replaced).toString()Returns a string representation of this record class.longtypeCode()The frame type's code on the wire.typeName()The frame type's name as the protocol's RFC spells it (DATA,HEADERS,SETTINGS, ...), orUNKNOWNfor an extension or reserved type.withData(byte[] newData) This frame with other content.withEndStream(boolean end) This frame with END_STREAM set or not (seeFrameInterceptorfor who decides).This frame withtext, encoded as UTF-8, as its content.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.microproxy.frames.Http2Frame
protocol
-
Constructor Details
-
Data
public Data(int streamId, byte[] data, boolean endStream) Creates DATA.- Parameters:
streamId- the stream, 1 or moredata- the content, not copiedendStream- whether the frame ends the stream
-
-
Method Details
-
typeName
Description copied from interface:HttpFrameThe frame type's name as the protocol's RFC spells it (DATA,HEADERS,SETTINGS, ...), orUNKNOWNfor an extension or reserved type. -
typeCode
public long typeCode()Description copied from interface:HttpFrameThe frame type's code on the wire. -
text
The content as UTF-8 text (malformed sequences replaced).- Returns:
- the decoded content
-
withData
This frame with other content.- Parameters:
newData- the new content- Returns:
- a copy with
newData
-
withText
This frame withtext, encoded as UTF-8, as its content.- Parameters:
text- the new content- Returns:
- a copy with the text
-
withEndStream
This frame with END_STREAM set or not (seeFrameInterceptorfor who decides).- Parameters:
end- whether the frame ends the stream- Returns:
- a copy with the flag
-
equals
Compares the content, not the array's identity. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
streamId
public int streamId()Returns the value of thestreamIdrecord component.- Specified by:
streamIdin interfaceHttp2Frame- Returns:
- the value of the
streamIdrecord component
-
data
public byte[] data()Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-
endStream
public boolean endStream()Returns the value of theendStreamrecord component.- Returns:
- the value of the
endStreamrecord component
-