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

Function ReadIntBytes

msgp/read_bytes.go:582–589  ·  view source on GitHub ↗

ReadIntBytes tries to read an int from 'b' and return the value and the remaining bytes. Possible errors: - [ErrShortBytes] (too few bytes) - [TypeError] (not a int) - [IntOverflow] (value doesn't fit in int; 32-bit platforms only)

(b []byte)

Source from the content-addressed store, hash-verified

580// - [TypeError] (not a int)
581// - [IntOverflow] (value doesn't fit in int; 32-bit platforms only)
582func ReadIntBytes(b []byte) (int, []byte, error) {
583 if smallint {
584 i, b, err := ReadInt32Bytes(b)
585 return int(i), b, err
586 }
587 i, b, err := ReadInt64Bytes(b)
588 return int(i), b, err
589}
590
591// ReadUint64Bytes tries to read a uint64
592// from 'b' and return the value and the remaining bytes.

Callers 6

UnmarshalMsgMethod · 0.92
UnmarshalMsgMethod · 0.92
UnmarshalMsgMethod · 0.92
UnmarshalMsgMethod · 0.92
FuzzReadBytesFunction · 0.85
UnmarshalMsgMethod · 0.85

Calls 2

ReadInt32BytesFunction · 0.85
ReadInt64BytesFunction · 0.85

Tested by 2

FuzzReadBytesFunction · 0.68
UnmarshalMsgMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…