'Called to determine how much room is left in the send window for a
given stream. Allows us to handle blocking and unblocking producers.
@param streamID: The ID of the stream whose flow control window we\'ll
check.
@type streamID: L{int}
@return: The amount of room remaining in the send window for the given
stream, including the data queued to be sent.
@rtype: L{int}'

def remainingOutboundWindow(self, streamID):

    windowSize = self.conn.local_flow_control_window(streamID)
    sendQueue = self._outboundStreamQueues[streamID]
    alreadyConsumed = sum((len(chunk) for chunk in sendQueue if (chunk is not _END_STREAM_SENTINEL)))
    return (windowSize - alreadyConsumed)
