Class StreamFrame
A QUIC frame carrying stream data bytes.
- 
Nested Class Summary
Nested classes/interfaces inherited from class Frame
Frame.WithStreamId - 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final longstatic final longFields inherited from class 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=0for a newStream.StreamFrame(long streamId, ByteBuffer data, long offset, boolean endStream) Creates a stream frame with the givenoffsetfor aStream.StreamFrame(long streamId, ByteBuffer data, long offset, boolean hasLength, boolean endStream) Creates a stream frame for aStream. - 
Method Summary
Methods inherited from class Frame.WithStreamId
getStreamIdMethods inherited from class 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=0for 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 theoffseton 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
offsetfor 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:
 toStringin classFrame.WithStreamId
 
 -