def stream(stream_id, update_max_id = true)
      raise ArgumentError, "stream_id can't be 0" if stream_id == 0

      stream = @streams[stream_id]
      if stream
        if stream.state == :idle && stream_id < @max_stream_ids[stream_id % 2]
          stream.set_state(:closed_implicitly)
        end
      elsif stream_id > @max_stream_ids[stream_id % 2]
        @max_stream_ids[stream_id % 2] = stream_id if update_max_id
        stream = Stream.new(self, stream_id, state: :idle)
        callback(:stream, stream)
        @streams[stream_id] = stream
      else
        stream = Stream.new(self, stream_id, state: :closed_implicitly)
        callback(:stream, stream)
      end

      stream
    end
def stream(stream_id, update_max_id = true)
      raise ArgumentError, "stream_id can't be 0" if stream_id == 0

      stream = @streams[stream_id]
      if stream
        if stream.state == :idle && stream_id < @max_stream_ids[stream_id % 2]
          stream.set_state(:closed_implicitly)
        end
      elsif stream_id > @max_stream_ids[stream_id % 2]
        @max_stream_ids[stream_id % 2] = stream_id if update_max_id
        stream = Stream.new(self, stream_id, state: :idle)
        callback(:stream, stream)
        @streams[stream_id] = stream
      else
        stream = Stream.new(self, stream_id, state: :closed_implicitly)
        callback(:stream, stream)
      end

      stream
    end
Returns a Stream object with the specified ID.
 @param stream_id [Integer] the stream id
 @return [Stream] the stream