// newWritableChunk creates a new writable chunk around a checksum and a buffer to hold data func newWritableChunk(checksum Checksum, contents *typed.WriteBuffer) *writableChunk { return &writableChunk{ size: 0, sizeRef: contents.DeferUint16(), checksum: checksum, contents: contents, } }
func writeHeaders(wb *typed.WriteBuffer, form http.Header) { numHeadersDeferred := wb.DeferUint16() numHeaders := uint16(0) for k, values := range form { for _, v := range values { wb.WriteLen16String(k) wb.WriteLen16String(v) numHeaders++ } } numHeadersDeferred.Update(numHeaders) }