Class StreamFrame
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.quic.api.frames.Frame
Frame.WithStreamId
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final long
static final long
Fields inherited from class org.eclipse.jetty.quic.api.frames.Frame
DEFAULT_MAX_SIZE
-
Constructor Summary
ConstructorsConstructorDescriptionStreamFrame
(long frameType, long streamId, ByteBuffer data, long offset, boolean endData) Creates a stream frame for aStream
.StreamFrame
(long streamId, ByteBuffer data, boolean endStream) Creates the first stream frame withoffset=0
for a newStream
.StreamFrame
(long streamId, ByteBuffer data, long offset, boolean endStream) Creates a stream frame with the givenoffset
for aStream
.StreamFrame
(long streamId, ByteBuffer data, long offset, boolean hasLength, boolean endStream) Creates a stream frame for aStream
. -
Method Summary
Methods inherited from class org.eclipse.jetty.quic.api.frames.Frame.WithStreamId
getStreamId
Methods inherited from class org.eclipse.jetty.quic.api.frames.Frame
getFrameType
-
Field Details
-
END_STREAM_MASK
public static final long END_STREAM_MASK- See Also:
-
LENGTH_MASK
public static final long LENGTH_MASK- See Also:
-
OFFSET_MASK
public static final long OFFSET_MASK- See Also:
-
-
Constructor Details
-
StreamFrame
Creates the first stream frame with
offset=0
for a newStream
.Applications should use this constructor in conjunction with
Session.newStream(long, Stream.Listener)
. For subsequent data to be sent on the same stream, applications should useStream.data(boolean, java.util.List, org.eclipse.jetty.util.Promise.Invocable)
, so that the implementation can compute theoffset
on behalf of the application.- Parameters:
streamId
- the stream id generated usingSession.newStreamId(boolean)
data
- the data bytes to sendendStream
- whether the data is the last to be sent
-
StreamFrame
Creates a stream frame with the given
offset
for aStream
.Applications should not use this constructor, but instead use
Stream.data(boolean, List, Promise.Invocable)
.- Parameters:
streamId
- the stream id generated usingSession.newStreamId(boolean)
data
- the data bytes to sendoffset
- the data offsetendStream
- whether the data is the last to be sent
-
StreamFrame
public StreamFrame(long streamId, ByteBuffer data, long offset, boolean hasLength, boolean endStream) Creates a stream frame for a
Stream
.Applications should not use this constructor, but instead use
Stream.data(boolean, List, Promise.Invocable)
.- Parameters:
streamId
- the stream id generated usingSession.newStreamId(boolean)
data
- the data bytes to sendoffset
- the data offsethasLength
- whether the frame explicitly specifies the data lengthendStream
- whether the data is the last to be sent
-
StreamFrame
Creates a stream frame for a
Stream
.Applications should not use this constructor, but instead use
Stream.data(boolean, List, Promise.Invocable)
.- Parameters:
frameType
- the frame typestreamId
- the stream id generated usingSession.newStreamId(boolean)
data
- the data bytes to sendoffset
- the data offset
-
-
Method Details
-
getOffset
public long getOffset()- Returns:
- the stream offset of the data bytes carried by this frame
-
getData
- Returns:
- the data bytes
-
getLength
public int getLength()- Returns:
- the number of data bytes
-
isEndStream
public boolean isEndStream()- Returns:
- whether this frame is the last in the stream
-
isEndData
public boolean isEndData()- Returns:
- whether this frame is the last carrying data for the stream
-
toString
- Overrides:
toString
in classFrame.WithStreamId
-