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

Function ReadInt32Bytes

msgp/read_bytes.go:534–540  ·  view source on GitHub ↗

ReadInt32Bytes tries to read an int32 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 int32)

(b []byte)

Source from the content-addressed store, hash-verified

532// - [TypeError] (not a int)
533// - [IntOverflow] (value doesn't fit in int32)
534func ReadInt32Bytes(b []byte) (int32, []byte, error) {
535 i, o, err := ReadInt64Bytes(b)
536 if i > math.MaxInt32 || i < math.MinInt32 {
537 return 0, o, IntOverflow{Value: i, FailedBitsize: 32}
538 }
539 return int32(i), o, err
540}
541
542// ReadInt16Bytes tries to read an int16
543// from 'b' and return the value and the remaining bytes.

Callers 6

UnmarshalMsgMethod · 0.92
UnmarshalMsgMethod · 0.92
mainFunction · 0.92
FuzzReadBytesFunction · 0.85
ReadIntBytesFunction · 0.85

Calls 1

ReadInt64BytesFunction · 0.85

Tested by 2

FuzzReadBytesFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…