MCPcopy Create free account
hub / github.com/dgrr/http2 / Deserialize

Method Deserialize

priority.go:54–63  ·  view source on GitHub ↗
(fr *FrameHeader)

Source from the content-addressed store, hash-verified

52}
53
54func (pry *Priority) Deserialize(fr *FrameHeader) (err error) {
55 if len(fr.payload) < 5 {
56 err = ErrMissingBytes
57 } else {
58 pry.stream = http2utils.BytesToUint32(fr.payload) & (1<<31 - 1)
59 pry.weight = fr.payload[4]
60 }
61
62 return
63}
64
65func (pry *Priority) Serialize(fr *FrameHeader) {
66 fr.payload = http2utils.AppendUint32Bytes(fr.payload[:0], pry.stream)

Callers

nothing calls this directly

Calls 1

BytesToUint32Function · 0.92

Tested by

no test coverage detected