Interface StreamByteDistributor.StreamState
- Enclosing interface:
StreamByteDistributor
public static interface StreamByteDistributor.StreamState
State information for the stream, indicating the number of bytes that are currently
streamable. This is provided to the
StreamByteDistributor.updateStreamableBytes(StreamState) method.-
Method Summary
Modifier and TypeMethodDescriptionbooleanhasFrame()Indicates whether or not there are frames pending for this stream.longGet the amount of bytes this stream has pending to send.stream()Gets the stream this state is associated with.intThe size (in bytes) of the stream's flow control window.
-
Method Details
-
stream
Http2Stream stream()Gets the stream this state is associated with. -
pendingBytes
long pendingBytes()Get the amount of bytes this stream has pending to send. The actual amount written must not exceedwindowSize()!- Returns:
- The amount of bytes this stream has pending to send.
- See Also:
-
hasFrame
boolean hasFrame()Indicates whether or not there are frames pending for this stream. -
windowSize
int windowSize()The size (in bytes) of the stream's flow control window. The amount written must not exceed this amount!A
StreamByteDistributorneeds to know the stream's window size in order to avoid allocating bytes if the window size is negative. The window size being0may also be significant to determine when if an stream has been given a chance to write an empty frame, and also enables optimizations like not writing empty frames in some situations (don't write headers until data can also be written).- Returns:
- the size of the stream's flow control window.
- See Also:
-