20 using std::unique_ptr;
26 bool huffmanEnabled) :
27 buf_(&bufQueue_, growthSize),
28 growthSize_(growthSize),
29 huffmanEnabled_(huffmanEnabled) {
43 buf->advance(headroom);
63 CHECK(nbit > 0 && nbit <= 8);
67 DCHECK_EQ(instruction & mask, 0);
83 while (value >= 128) {
84 byte = 128 | (127 &
value);
116 DCHECK_EQ(instruction & huffmanOn, 0);
119 count += huffmanTree.encode(literal,
buf_);
137 count += literal.
size();
uint32_t encodeHuffman(folly::StringPiece literal)
void append(uint8_t byte)
HPACKEncodeBuffer(uint32_t growthSize, bool huffmanEnabled)
folly::IOBufQueue bufQueue_
const folly::IOBuf * front() const
void append(std::unique_ptr< folly::IOBuf > &&buf, bool pack=false)
uint32_t encodeLiteral(folly::StringPiece literal)
constexpr detail::Map< Move > move
constexpr size_type size() const
static std::string printBin(const folly::IOBuf *buf, bool coalesce=false)
void push(const uint8_t *buf, size_t len)
void addHeadroom(uint32_t bytes)
constexpr auto size(C const &c) -> decltype(c.size())
constexpr Iter data() const
uint32_t encodeInteger(uint64_t value, uint8_t instruction, uint8_t nbit)
static const char *const value
folly::io::QueueAppender buf_
const HuffTree & huffTree()
const uint8_t NBIT_MASKS[9]