MCPcopy
hub / github.com/tinylib/msgp / ReadExtensionBytes

Function ReadExtensionBytes

msgp/extension.go:492–501  ·  view source on GitHub ↗

ReadExtensionBytes reads an extension from 'b' into 'e' and returns any remaining bytes. Possible errors: - ErrShortBytes ('b' not long enough) - ExtensionTypeError{} (wire type not the same as e.Type()) - TypeError{} (next object not an extension) - InvalidPrefixError - An umarshal error returned f

(b []byte, e Extension)

Source from the content-addressed store, hash-verified

490// - InvalidPrefixError
491// - An umarshal error returned from e.UnmarshalBinary
492func ReadExtensionBytes(b []byte, e Extension) ([]byte, error) {
493 typ, remain, data, err := readExt(b)
494 if err != nil {
495 return b, err
496 }
497 if typ != e.ExtensionType() {
498 return b, errExt(typ, e.ExtensionType())
499 }
500 return remain, e.UnmarshalBinary(data)
501}
502
503// readExt will read the extension type, and return remaining bytes,
504// as well as the data of the extension.

Callers 5

FuzzReadBytesFunction · 0.85
rwExtensionBytesFunction · 0.85
readIntfBytesDepthFunction · 0.85

Calls 4

readExtFunction · 0.85
errExtFunction · 0.85
ExtensionTypeMethod · 0.65
UnmarshalBinaryMethod · 0.65

Tested by 3

FuzzReadBytesFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…