Most direct calls to HPACK functions are made to encode short header fields like methods, schemes or statuses, whose lengths and indexes are known. Let's have a small function to do this.