Interface StreamByteDistributor.StreamState

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean hasFrame()
      Indicates whether or not there are frames pending for this stream.
      long pendingBytes()
      Get the amount of bytes this stream has pending to send.
      Http2Stream stream()
      Gets the stream this state is associated with.
      int windowSize()
      The size (in bytes) of the stream's flow control window.
    • Method Detail

      • stream

        Http2Stream stream()
        Gets the stream this state is associated with.
      • 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 StreamByteDistributor needs to know the stream's window size in order to avoid allocating bytes if the window size is negative. The window size being 0 may 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:
        Http2CodecUtil.streamableBytes(StreamState)